Compare commits

...

3449 Commits

Author SHA1 Message Date
Matthias Bertschy
b167435c4d Merge pull request #1941 from kubescape/semver
fix isRuleKubescapeVersionCompatible bug with version 4.0.0
2026-02-12 15:14:45 +00:00
Matthias Bertschy
9b29321a53 Enhance version testing in smoke tests to extract and validate output version
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-12 14:56:31 +01:00
Matthias Bertschy
466a11fa1c fix isRuleKubescapeVersionCompatible bug with version 4.0.0
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-12 14:08:03 +01:00
Matthias Bertschy
cfe022ff1d Use TagName directly in .krew.yaml templates 2026-02-04 18:16:34 +01:00
Matthias Bertschy
e0eeb691e6 Make version smoke test accept bytes and v-prefix 2026-02-04 17:44:39 +01:00
Matthias Bertschy
dc65bd4ccc force overridden ldflags in goreleaser
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-04 17:19:54 +01:00
Matthias Bertschy
02790da144 remove invalid build flag
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-04 11:42:11 +01:00
Matthias Bertschy
b97f50ffb5 fix version handling and injection
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-04 10:42:12 +01:00
Matthias Bertschy
0841d1d483 Merge pull request #1939 from kubescape/feat/performance-optimization-phases-1-3
feat: Optimize CPU and Memory Usage for Resource-Intensive Scans
2026-02-04 07:47:47 +00:00
Matthias Bertschy
fbef268f22 feat: optimize CPU and memory usage for resource-intensive scans
Implement Phases 1-3 of the performance optimization plan to address
issue #1793 - reduce CPU and memory consumption for system-constrained
environments.

Phase 1 - OPA Module Caching:
- Add compiledModules cache to OPAProcessor with thread-safe access
- Cache compiled OPA rules to eliminate redundant compilation
- Reuse compiled modules with double-checked locking pattern
- Expected CPU savings: 30-40%

Phase 2 - Map Pre-sizing:
- Add estimateClusterSize() to calculate resource count
- Pre-size AllResources, ResourcesResult, and related maps
- Reduce memory reallocations and GC pressure
- Expected memory savings: 10-20%

Phase 3 - Set-based Deduplication:
- Add thread-safe StringSet utility in core/pkg/utils
- Replace O(n) slices.Contains() with O(1) map operations
- Use StringSet for image scanning and related resources deduplication
- 100% test coverage for new utility
- Expected CPU savings: 5-10% for large clusters

Full optimization plan documented in optimization-plan.md

Related: #1793
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-04 08:07:54 +01:00
Matthias Bertschy
427dccadd3 Merge pull request #1934 from kubescape/krew
Add krew plugin manifest
2026-02-03 17:12:33 +00:00
Matthias Bertschy
01bb19bf6e Add krew plugin manifest
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-03 17:58:30 +01:00
Matthias Bertschy
c0d4bb45eb Merge pull request #1937 from kubescape/dependabot/go_modules/github.com/theupdateframework/go-tuf/v2-2.4.1
build(deps): Bump github.com/theupdateframework/go-tuf/v2 from 2.3.1 to 2.4.1
2026-02-03 14:50:06 +00:00
Matthias Bertschy
222c1ec866 Merge pull request #1931 from Mujib-Ahasan/readmd-update
Fix broken README table of contents anchor links
2026-02-03 14:44:36 +00:00
dependabot[bot]
dc49218c7c build(deps): Bump github.com/theupdateframework/go-tuf/v2
Bumps [github.com/theupdateframework/go-tuf/v2](https://github.com/theupdateframework/go-tuf) from 2.3.1 to 2.4.1.
- [Release notes](https://github.com/theupdateframework/go-tuf/releases)
- [Commits](https://github.com/theupdateframework/go-tuf/compare/v2.3.1...v2.4.1)

---
updated-dependencies:
- dependency-name: github.com/theupdateframework/go-tuf/v2
  dependency-version: 2.4.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-03 13:12:03 +01:00
Matthias Bertschy
3b4585a827 Merge pull request #1932 from kubescape/scan-images
add verbose option to scan-images
2026-02-02 19:30:00 +00:00
Matthias Bertschy
7f79bc2d1d Sort CVEs by severity then ID
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-02 17:51:43 +01:00
Matthias Bertschy
3623e55433 feat: add image column to vulnerability scanning table output
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-02 17:51:43 +01:00
Matthias Bertschy
2f7841b5a2 update policy.json testdata
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-02 17:51:43 +01:00
Matthias Bertschy
f70d81d7c4 add verbose option to scan-images
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-02 17:51:43 +01:00
Matthias Bertschy
bd49251234 Merge pull request #1936 from kubescape/lint
fix all linter errors
2026-02-02 16:50:48 +00:00
Matthias Bertschy
57addd493f fix all linter errors
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-02-02 17:32:08 +01:00
Matthias Bertschy
8f009d4698 Merge pull request #1935 from kubescape/run_test_from_private_repo
run system test from private repo
2026-02-02 08:35:08 +00:00
bvolovat
7c0e38072d run system test from private repo 2026-02-02 10:22:00 +02:00
bvolovat
aa9a610c4c run system test from private repo 2026-02-02 10:03:25 +02:00
Bezbran
25bd51e8b4 Replace host sensor with node agent sensing (#1916)
In this change I used both claude code and Antigravity.

---------

Signed-off-by: Bezalel Brandwine <bez@softwine.net>
2026-02-01 13:17:03 +02:00
Mujib Ahasan
2759beece5 Fix broken README anchors
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2026-01-26 02:25:55 +05:30
Matthias Bertschy
6ce0121a03 Merge pull request #1928 from kubescape/dependabot/go_modules/github.com/sigstore/rekor-1.5.0
build(deps): Bump github.com/sigstore/rekor from 1.4.3 to 1.5.0
2026-01-22 20:24:28 +00:00
Matthias Bertschy
09aa1ab866 Merge pull request #1927 from kubescape/dependabot/go_modules/github.com/theupdateframework/go-tuf/v2-2.3.1
build(deps): Bump github.com/theupdateframework/go-tuf/v2 from 2.3.0 to 2.3.1
2026-01-22 20:24:08 +00:00
dependabot[bot]
0ec188b23d build(deps): Bump github.com/sigstore/rekor from 1.4.3 to 1.5.0
Bumps [github.com/sigstore/rekor](https://github.com/sigstore/rekor) from 1.4.3 to 1.5.0.
- [Release notes](https://github.com/sigstore/rekor/releases)
- [Changelog](https://github.com/sigstore/rekor/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/rekor/compare/v1.4.3...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/sigstore/rekor
  dependency-version: 1.5.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-22 20:50:11 +01:00
dependabot[bot]
090820ba04 build(deps): Bump github.com/theupdateframework/go-tuf/v2
Bumps [github.com/theupdateframework/go-tuf/v2](https://github.com/theupdateframework/go-tuf) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/theupdateframework/go-tuf/releases)
- [Commits](https://github.com/theupdateframework/go-tuf/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: github.com/theupdateframework/go-tuf/v2
  dependency-version: 2.3.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-22 20:49:44 +01:00
Matthias Bertschy
0cf24d058f Merge pull request #1926 from kubescape/copilot/fix-kubescan-interface-error
Fix panic on unsafe interface{} to string type assertions
2026-01-22 19:43:25 +00:00
copilot-swe-agent[bot]
c32e665809 Final verification - all changes complete
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-22 17:13:09 +01:00
copilot-swe-agent[bot]
82ec11b207 Fix indentation in test file
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2026-01-22 12:42:42 +00:00
copilot-swe-agent[bot]
32a15acdea Add test for CheckShortTerminalWidth with non-string values
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2026-01-22 12:41:14 +00:00
copilot-swe-agent[bot]
837a50c903 Fix unsafe interface to string type assertions to prevent panic
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2026-01-22 12:37:43 +00:00
copilot-swe-agent[bot]
bd00d153e9 Initial plan 2026-01-22 12:33:31 +00:00
Matthias Bertschy
306050046d Merge pull request #1923 from kubescape/dependabot/go_modules/github.com/sigstore/fulcio-1.8.5
build(deps): Bump github.com/sigstore/fulcio from 1.8.4 to 1.8.5
2026-01-20 07:41:16 +00:00
dependabot[bot]
413db87e85 build(deps): Bump github.com/sigstore/fulcio from 1.8.4 to 1.8.5
Bumps [github.com/sigstore/fulcio](https://github.com/sigstore/fulcio) from 1.8.4 to 1.8.5.
- [Release notes](https://github.com/sigstore/fulcio/releases)
- [Changelog](https://github.com/sigstore/fulcio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/fulcio/compare/v1.8.4...v1.8.5)

---
updated-dependencies:
- dependency-name: github.com/sigstore/fulcio
  dependency-version: 1.8.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-20 08:07:08 +01:00
Matthias Bertschy
4d3b3efb9a Merge pull request #1922 from kubescape/copilot/fix-kubescape-report-discrepancy
Fix workload scan to include allcontrols framework
2026-01-16 15:18:11 +00:00
copilot-swe-agent[bot]
7ca609d39f Complete fix for workload scan missing controls
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2026-01-16 15:03:01 +00:00
copilot-swe-agent[bot]
872c0c9fab Fix workload scan to include allcontrols framework
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2026-01-16 14:58:58 +00:00
copilot-swe-agent[bot]
9353eb5b54 Initial plan 2026-01-16 14:49:43 +00:00
Matthias Bertschy
aa62fbea68 Merge pull request #1921 from kubescape/buildnumber
Update build number retrieval and permissions in workflow
2026-01-16 12:21:04 +00:00
Matthias Bertschy
08d964b631 Update golangci-lint action to version 9
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-16 12:39:54 +01:00
Matthias Bertschy
75fb07efde Update build number retrieval and permissions in workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-16 12:18:19 +01:00
Matthias Bertschy
9445e0aa01 Merge pull request #1920 from kubescape/dependabot/go_modules/github.com/sigstore/cosign/v3-3.0.4
build(deps): Bump github.com/sigstore/cosign/v3 from 3.0.3-0.20251208232815-901b44d65952 to 3.0.4
2026-01-16 10:45:55 +00:00
Matthias Bertschy
ea12643a3c Fix workflow YAML formatting and permissions
Reformat the 00-pr-scanner workflow for consistent indentation. Add
artifact-metadata: read to pr-scanner permissions, include GO111MODULE
in the pr-scanner inputs, and set fetch-depth/submodules on the
actions/checkout step
2026-01-16 11:42:55 +01:00
dependabot[bot]
0c42b41dcc build(deps): Bump github.com/sigstore/cosign/v3
Bumps [github.com/sigstore/cosign/v3](https://github.com/sigstore/cosign) from 3.0.3-0.20251208232815-901b44d65952 to 3.0.4.
- [Release notes](https://github.com/sigstore/cosign/releases)
- [Changelog](https://github.com/sigstore/cosign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/cosign/commits/v3.0.4)

---
updated-dependencies:
- dependency-name: github.com/sigstore/cosign/v3
  dependency-version: 3.0.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-16 11:31:31 +01:00
Amir Malka
351f957083 update test lists (#1919) 2026-01-11 21:50:37 +02:00
Matthias Bertschy
9d876b14e9 Merge pull request #1918 from AndrewCharlesHay/patch-1
ci: update scorecard action version
2026-01-06 14:22:11 +00:00
Andy Hay
895233630f ci: update scorecard action version
Signed-off-by: Andy Hay <39sumer3939@gmail.com>
2026-01-05 16:44:26 -05:00
Matthias Bertschy
423d9c5c1f Merge pull request #1917 from BroderPeters/master
Add SkipPersistence flag to MetricsQueryParams in metrics endpoint
2026-01-05 12:48:35 +00:00
Broder Peters
3f3681a4cd Add SkipPersistence flag to MetricsQueryParams in metrics endpoint
Signed-off-by: Broder Peters <broder.peters@protonmail.com>
2026-01-05 13:24:21 +01:00
Matthias Bertschy
d6ccc37640 Merge pull request #1915 from majiayu000/fix-1660-define-labels-to-copy-from-wor-1231-0603
feat: Define labels to copy from workloads to reports
2026-01-05 06:50:47 +00:00
Matthias Bertschy
3b6bc00b03 Merge pull request #1914 from majiayu000/fix-1617-kustomize-directory-analysis-n-1231-0603
fix: Kustomize directory analysis not working
2026-01-05 06:45:06 +00:00
Matthias Bertschy
8984f941ab Update README to include GoReleaser installation and usage instructions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2026-01-05 07:27:39 +01:00
majiayu000
46eb266064 feat: add labels-to-copy flag to copy workload labels to reports
Add a new --labels-to-copy CLI flag that allows users to specify which
labels from Kubernetes workloads should be extracted and included in
scan reports. This makes it easier to tie scan results back to app
teams or repositories by including relevant labels like 'app', 'team',
or 'environment' in the report output.

Changes:
- Add LabelsToCopy field to ScanInfo and OPASessionObj structs
- Add --labels-to-copy flag to scan command
- Add ResourceLabels field to PostureReportWithSeverity for JSON output
- Implement extractResourceLabels function to extract specified labels
- Add unit tests for label extraction functionality

Fixes #1660

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
2025-12-31 06:20:29 +08:00
majiayu000
0f2125817b fix: enable kustomize overlays to load base configurations
Fixes #1617. The kustomize build was failing for overlays that reference
base configurations in parent directories (e.g., ../../base). This was
because krusty.MakeDefaultOptions() defaults to LoadRestrictionsRootOnly,
which prevents loading resources from outside the kustomize directory.

Changed LoadRestrictions to LoadRestrictionsNone to allow overlays to
properly resolve and merge base configurations during scanning.

Added tests to verify:
- Overlay directories can successfully load resources from base directories
- Base directories continue to work as before
- The merged configuration includes resources from both base and overlay

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
2025-12-31 06:14:10 +08:00
Matthias Bertschy
1225540590 Merge pull request #1913 from oglok/fix-typos-in-docs
Fix typos in documentation
2025-12-30 21:55:50 +01:00
Ricardo Noriega De Soto
0e4ff13276 Fix typos in documentation
Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
2025-12-30 21:03:50 +01:00
Matthias Bertschy
5fed9cc507 Enhance installation scripts for cross-platform support and improve error handling
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-15 08:52:05 +01:00
Matthias Bertschy
06241fce03 Refactor release workflow to simplify tagging and remove unnecessary inputs
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-15 08:08:07 +01:00
Matthias Bertschy
2b91023c6b Update release workflow to include tagging in arguments
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-15 07:59:26 +01:00
Matthias Bertschy
082edf52d9 Refactor GitHub Actions workflow for system tests and update smoke test logging
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-15 07:47:09 +01:00
Matthias Bertschy
be250ff090 Add debug listing and adjust JUnit report options 2025-12-12 22:50:32 +01:00
Matthias Bertschy
d74803af28 Add skip flag and collect system test results
Add workflow input skip_system_tests and make RUN_E2E respect it. Add
System Tests Report step to publish JUnit XMLs. Update
goreleaser-post-e2e.sh to add GitHub Actions log grouping, capture
per-test logs under test-results/system-tests, and copy JUnit XML
results while preserving directory structure.
2025-12-12 22:24:30 +01:00
Matthias Bertschy
893bb86035 Add production secrets to release workflow 2025-12-12 21:40:29 +01:00
Matthias Bertschy
314a74b817 Require Python 3.9 for system tests
Update CI workflow and goreleaser post-e2e script to use Python 3.9.
Rename SYSTEST_REQUIRE_PY311 to SYSTEST_REQUIRE_PY39, prefer python3.9,
and change version checks to refuse venvs created with Python 3.10+. If
python3.9 is missing or wrong, honor E2E_FAIL_ON_ERROR: either fail the
release or skip system tests and clean up.
2025-12-12 21:25:01 +01:00
Matthias Bertschy
997bc2d23b Use python3-dev in release workflow 2025-12-12 21:10:24 +01:00
Matthias Bertschy
5d1699291a Install system dependencies in release workflow
Add apt-get step to install libpq5, libpq-dev, gcc, and python3.11-dev
for system tests and clean apt lists
2025-12-12 16:16:48 +01:00
Matthias Bertschy
bfca19bf25 Remove pip cache from release workflow 2025-12-12 15:59:11 +01:00
Matthias Bertschy
1b94d27fd6 Require Python 3.11 for system tests 2025-12-12 15:56:12 +01:00
Matthias Bertschy
acf7ad04ed fix go mod tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 15:36:56 +01:00
Matthias Bertschy
0f5775065e fix: prefer Python 3.11 for system-tests and update environment setup
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 15:36:37 +01:00
Matthias Bertschy
66fbca8f24 Merge pull request #1911 from kubescape/copilot/fix-local-file-path-issue
Fix: Prevent self-hosted git URLs from being treated as local file paths
2025-12-12 15:14:43 +01:00
Matthias Bertschy
1f8de23a65 fix: update post-build hook to conditionally execute script for amd64 architecture
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 14:56:03 +01:00
Matthias Bertschy
89478eabcc fix: add k8s Kind cluster creation step and clean up post-e2e script
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 14:51:43 +01:00
Matthias Bertschy
6be9aec5b0 fix: update test_command and test_scan to remove deprecated scan commands and adjust file paths
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 14:39:11 +01:00
Matthias Bertschy
32551275ba fix: correct post-build hook syntax for setting GOARCH environment variable
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 14:31:27 +01:00
Matthias Bertschy
4ee6238244 fix: update post-build hook to set GOARCH environment variable
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 14:22:07 +01:00
Matthias Bertschy
54dda8bf31 fix: enable end-to-end tests in release workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 14:09:26 +01:00
Matthias Bertschy
270b3b320d fix: enhance release workflow with optional skip publish input and add system tests execution
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 13:19:52 +01:00
Matthias Bertschy
fa17ca26e1 fix: enhance release workflow with optional skip publish input and add system tests execution
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-12 12:47:23 +01:00
copilot-swe-agent[bot]
66e970a3dc Update go-git-url to v0.0.31 for improved URL parsing
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-11 16:59:59 +00:00
Matthias Bertschy
d10d08c02b fix: update e2e script to enforce fatal failures and improve artifact detection
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-11 15:22:48 +01:00
copilot-swe-agent[bot]
8d7c595a76 Address code review feedback: Extract helper function and improve comments
- Add isHTTPURL helper function for better code reusability
- Improve comments to clarify why ContextDir is returned
- Enhance error message for unrecognized git repositories

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-11 09:16:12 +00:00
copilot-swe-agent[bot]
621ffd3ead Fix: Prevent URLs from being treated as local file paths
- Add URL detection (http:// and https://) in getScanningContext
- Prevent URLs from being joined with current working directory
- Add test cases for self-hosted GitLab URLs
- Ensure proper error handling when git clone fails

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-11 09:08:12 +00:00
copilot-swe-agent[bot]
5dee6d0e4f Initial plan 2025-12-11 08:57:35 +00:00
Matthias Bertschy
f516853af8 fix: update kubescape krew configuration to skip upload
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-11 07:42:00 +01:00
Matthias Bertschy
0d01329683 fix: add commit author information to goreleaser configuration
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-11 07:12:40 +01:00
Matthias Bertschy
5a0f5f98c1 fix: update krew index pull request configuration to specify owner and name
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 22:49:11 +01:00
Matthias Bertschy
771fc4acca fix: correct kubescape repository owner in goreleaser configuration
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 22:30:54 +01:00
Matthias Bertschy
68a9d0cf60 fix: update GITHUB_TOKEN handling and correct kubescape repository owner in configuration
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 22:06:49 +01:00
Matthias Bertschy
d2bc957500 fix: update kubescape krew configuration to use repository field
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 21:52:32 +01:00
Matthias Bertschy
d20ec9e471 feat: add kubescape krew index to goreleaser configuration
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 21:47:48 +01:00
Matthias Bertschy
d3824028c5 feat: add QEMU and Docker Buildx setup steps in release workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 21:30:40 +01:00
Matthias Bertschy
5013f91814 feat: add Syft setup step in release workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 21:16:24 +01:00
Matthias Bertschy
41e47c3ad3 fix: update runner to ubuntu-large in release configuration
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 19:15:48 +01:00
Matthias Bertschy
acfe986863 fix: add cosign.key to .gitignore
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 18:41:39 +01:00
Matthias Bertschy
abafa9eafa fix: remove unnecessary secrets inheritance in release configuration
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 18:35:10 +01:00
Matthias Bertschy
dce1ee4dc6 cleaning up release action
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 18:31:25 +01:00
Matthias Bertschy
62a143326c Merge pull request #1816 from kubescape/goreleaser
use goreleaser for all builds and release publication
2025-12-10 07:58:52 +01:00
Matthias Bertschy
d72a6005bb use goreleaser for all builds and release publication
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-10 07:43:21 +01:00
Matthias Bertschy
adb9b80442 Merge pull request #1903 from Mujib-Ahasan/skip-persistence
Add `skipPersistence` query parameter to `/v1/metrics`
2025-12-09 17:46:12 +01:00
Mujib Ahasan
cb7cca7b44 fix: log added and minor fixes applied
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2025-12-09 22:07:29 +05:30
Matthias Bertschy
f38bec9314 fix go mod tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-09 17:29:51 +01:00
Matthias Bertschy
fff663bed4 Merge pull request #1907 from kubescape/dependabot/go_modules/github.com/containerd/containerd/v2-2.1.5
Bump github.com/containerd/containerd/v2 from 2.1.4 to 2.1.5
2025-12-09 12:29:17 +01:00
dependabot[bot]
6a72851182 Bump github.com/containerd/containerd/v2 from 2.1.4 to 2.1.5
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.1.4 to 2.1.5.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.4...v2.1.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-09 12:12:46 +01:00
Matthias Bertschy
e4962fe934 Merge pull request #1906 from kubescape/cosign
Update cosign package to v3 and adjust go.mod dependencies
2025-12-09 12:11:42 +01:00
Matthias Bertschy
dac3af19a3 Update cosign package to v3 and adjust go.mod dependencies
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-09 11:57:01 +01:00
Matthias Bertschy
0b44e94b67 Merge pull request #1905 from kubescape/cosign
Update cosign package to v3 and adjust go.mod dependencies
2025-12-09 11:44:07 +01:00
Matthias Bertschy
df37457504 Update cosign package to v3 and adjust go.mod dependencies
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-09 11:24:29 +01:00
Matthias Bertschy
f88a374b6d Merge pull request #1904 from kubescape/dependabot/go_modules/github.com/sigstore/fulcio-1.8.3
Bump github.com/sigstore/fulcio from 1.6.6 to 1.8.3
2025-12-09 10:46:10 +01:00
dependabot[bot]
47442f954c Bump github.com/sigstore/fulcio from 1.6.6 to 1.8.3
Bumps [github.com/sigstore/fulcio](https://github.com/sigstore/fulcio) from 1.6.6 to 1.8.3.
- [Release notes](https://github.com/sigstore/fulcio/releases)
- [Changelog](https://github.com/sigstore/fulcio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/fulcio/compare/v1.6.6...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/sigstore/fulcio
  dependency-version: 1.8.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-09 10:32:26 +01:00
Mujib Ahasan
efbb8e8367 feature: skipPersistence request parameter added
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2025-12-05 22:18:35 +05:30
Matthias Bertschy
60d7276de3 Merge pull request #1901 from kubescape/copilot/fix-cis-framework-metrics-export
Fix CIS framework metrics not exported to Prometheus /v1/metrics endpoint
2025-12-05 09:45:06 +01:00
copilot-swe-agent[bot]
c05427ff38 Remove KS_METRICS_FRAMEWORKS environment variable support
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-05 09:43:49 +01:00
Matthias Bertschy
3e245da02b Merge pull request #1902 from kubescape/copilot/fix-air-gapped-configuration
Fix air-gapped mode network access attempts
2025-12-05 08:44:50 +01:00
copilot-swe-agent[bot]
cc7aae470f Fix typo in comment: fom -> from
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-04 13:47:52 +00:00
copilot-swe-agent[bot]
8d59a6074e Add frameworks query parameter to /v1/metrics endpoint
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-04 13:45:55 +00:00
copilot-swe-agent[bot]
1f7dd6e5f5 Fix incorrect comment about default output format
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-04 13:31:52 +00:00
copilot-swe-agent[bot]
bf5ca3c1f0 Add KS_METRICS_FRAMEWORKS env var to allow selecting specific frameworks
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-04 13:30:11 +00:00
copilot-swe-agent[bot]
a8574c61ea Fix: properly handle nil downloadReleasedPolicy in getters
Ensure getter functions handle nil downloadReleasedPolicy correctly by creating a new instance when needed, maintaining backward compatibility with existing code while supporting air-gapped mode.

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 21:19:39 +00:00
copilot-swe-agent[bot]
6f9c0ae85f Address code review feedback
- Fix string field checks in isAirGappedMode (use != "" instead of len() > 0)
- Use centralized isAirGappedMode function in getResourceHandler
- Improve comment clarity to reflect all air-gapped conditions

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 21:14:04 +00:00
copilot-swe-agent[bot]
be2c74e48a Add test for isAirGappedMode function
Add comprehensive tests to verify air-gapped mode detection logic.

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 21:11:18 +00:00
copilot-swe-agent[bot]
68da73855f Refactor: Extract isAirGappedMode helper function
Extract complex boolean condition into a dedicated helper function for better readability and maintainability.

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 21:06:52 +00:00
copilot-swe-agent[bot]
5b3f2d0ff9 Fix air-gapped mode to prevent network access
- Skip version check when --keep-local flag is set
- Skip DownloadReleasedPolicy initialization when in air-gapped mode
- Skip KSCloudAPIConnector initialization when --keep-local is set

Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 21:03:01 +00:00
copilot-swe-agent[bot]
02637c7a8e Initial plan 2025-12-03 20:50:40 +00:00
Matthias Bertschy
7d5b374f9d Merge pull request #1900 from kubescape/copilot/fix-severity-missing-json
Add severity field to controls in JSON output
2025-12-03 21:44:49 +01:00
copilot-swe-agent[bot]
1dd6d7a1b3 Address code review feedback: nil check and trailing whitespace
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 16:46:11 +00:00
copilot-swe-agent[bot]
6b80b85555 Add tests for results enrichment with severity
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 16:42:03 +00:00
copilot-swe-agent[bot]
d88bc067e2 Add severity to controls in results section as well
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 16:40:48 +00:00
copilot-swe-agent[bot]
ba78527c80 Enable ScanAll for prometheus metrics to include all frameworks including CIS
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 16:32:43 +00:00
copilot-swe-agent[bot]
4c8692bf8c Remove test output files and update gitignore 2025-12-03 16:32:29 +00:00
copilot-swe-agent[bot]
742e3bb67f Add severity field to controls in JSON output
Co-authored-by: matthyx <20683409+matthyx@users.noreply.github.com>
2025-12-03 16:31:57 +00:00
copilot-swe-agent[bot]
a39f36c9fb Initial plan 2025-12-03 16:18:31 +00:00
copilot-swe-agent[bot]
9bc29032e1 Initial plan 2025-12-03 16:12:04 +00:00
Matthias Bertschy
a4a290a3ce Merge pull request #1898 from kubescape/dependabot/go_modules/github.com/cilium/cilium-1.16.17
Bump github.com/cilium/cilium from 1.16.9 to 1.16.17
2025-12-02 17:12:06 +01:00
dependabot[bot]
379a3fbc27 Bump github.com/cilium/cilium from 1.16.9 to 1.16.17
Bumps [github.com/cilium/cilium](https://github.com/cilium/cilium) from 1.16.9 to 1.16.17.
- [Release notes](https://github.com/cilium/cilium/releases)
- [Changelog](https://github.com/cilium/cilium/blob/1.16.17/CHANGELOG.md)
- [Commits](https://github.com/cilium/cilium/compare/1.16.9...1.16.17)

---
updated-dependencies:
- dependency-name: github.com/cilium/cilium
  dependency-version: 1.16.17
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-12-02 12:34:17 +01:00
Matthias Bertschy
a46098c034 Merge pull request #1896 from kubescape/summaries
always save WorkloadConfigurationScanResultSummaries
2025-12-01 08:05:57 +01:00
Matthias Bertschy
440f39ba3e Merge pull request #1897 from kubescape/docs
Revamp documentation
2025-11-30 11:47:23 +01:00
Matthias Bertschy
b6a4e282f9 Revamp documentation and reduce host sensor workers
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-30 11:47:00 +01:00
Matthias Bertschy
8deff34d12 always save WorkloadConfigurationScanResultSummaries
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-28 16:45:23 +01:00
Matthias Bertschy
acc9b54b2b Merge pull request #1895 from pfarikrispy/pfarikrispy-patch-1
update from Debian 12 to 13 when building container images
2025-11-26 14:52:53 +01:00
Christian Peper
1ffa29fbaa feat(security): update golang to debian trixie
build in the same env as the final image

Signed-off-by: Christian Peper <dreamszz@gmail.com>
2025-11-26 14:34:49 +01:00
Christian Peper
2ae30a8162 feat(security): update to Debian 13
Signed-off-by: Christian Peper <dreamszz@gmail.com>
2025-11-26 14:32:41 +01:00
Christian Peper
0ca5378c6b feat(security): update to Debian 13
use debian 13 as a base image

Signed-off-by: Christian Peper <dreamszz@gmail.com>
2025-11-26 14:30:46 +01:00
Matthias Bertschy
f51a1281f7 Merge pull request #1892 from kubescape/dependabot/go_modules/httphandler/golang.org/x/crypto-0.45.0
Bump golang.org/x/crypto from 0.41.0 to 0.45.0 in /httphandler
2025-11-21 20:59:38 +01:00
dependabot[bot]
5469d8bc04 Bump golang.org/x/crypto from 0.41.0 to 0.45.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.41.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.41.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 17:10:28 +01:00
Matthias Bertschy
bd7c0c580e fix go mod tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-11 17:52:55 +01:00
Matthias Bertschy
154fec1385 Allow artifact-metadata read in release workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-11 16:14:32 +01:00
Matthias Bertschy
5c2275e32a Allow artifact-metadata read in release workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-11 16:13:16 +01:00
Matthias Bertschy
2da4736201 fix workflow permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-11 16:10:15 +01:00
Matthias Bertschy
aefafeae6f Merge pull request #1890 from kubescape/dependabot/go_modules/github.com/opencontainers/selinux-1.13.0
Bump github.com/opencontainers/selinux from 1.12.0 to 1.13.0
2025-11-11 14:10:59 +01:00
dependabot[bot]
1772b38b8c Bump github.com/opencontainers/selinux from 1.12.0 to 1.13.0
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/selinux
  dependency-version: 1.13.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-11 12:44:20 +00:00
Matthias Bertschy
c844f42208 Merge pull request #1889 from kubescape/dependabot/go_modules/github.com/containerd/containerd-1.7.29
Bump github.com/containerd/containerd from 1.7.28 to 1.7.29
2025-11-07 08:44:37 +01:00
dependabot[bot]
b86d051998 Bump github.com/containerd/containerd from 1.7.28 to 1.7.29
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.28 to 1.7.29.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.28...v1.7.29)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-version: 1.7.29
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-07 08:32:59 +01:00
Matthias Bertschy
aaa8d1ed35 Merge pull request #1888 from kubescape/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.7
Bump github.com/containerd/containerd/v2 from 2.0.5 to 2.0.7
2025-11-07 08:16:43 +01:00
dependabot[bot]
441d16aa08 Bump github.com/containerd/containerd/v2 from 2.0.5 to 2.0.7
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.5 to 2.0.7.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.5...v2.0.7)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.0.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-07 08:04:26 +01:00
Matthias Bertschy
b33f1c8cc7 Merge pull request #1887 from Mujib-Ahasan/fix-print-sarif
fix: --format sarif logs as expected
2025-11-05 18:17:31 +01:00
Mujib Ahasan
4929af510e fix: --format sarif logs as expected
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2025-11-04 20:30:10 +05:30
mandronic
f28bb11c55 removed 'procMount: Unmasked' from host-scanner daemonset definition (refs kubescape/helm-charts#711) (#1886)
Signed-off-by: Mihail Andronic <104365774+mandronic@users.noreply.github.com>
2025-11-03 13:40:14 +02:00
Matthias Bertschy
8bff4a02e1 Merge pull request #1884 from Mujib-Ahasan/fix-url
fixed "404" URL issue for command $kubescape scan.
2025-11-03 11:11:55 +01:00
Matthias Bertschy
33d1e018ec fix: update documentation links to include 'controls' path
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-11-03 07:47:37 +01:00
Mujib Ahasan
0c74599314 Test file updated
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2025-10-30 01:14:25 +05:30
Mujib Ahasan
c23b85cc84 fixed 404 url issue in kubescape scan
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2025-10-25 17:39:28 +05:30
Matthias Bertschy
aab10d14a2 Merge pull request #1881 from kubescape/dependabot/go_modules/github.com/nwaples/rardecode/v2-2.2.0
Bump github.com/nwaples/rardecode/v2 from 2.1.1 to 2.2.0
2025-10-21 09:45:29 +02:00
dependabot[bot]
2fcbe54e4e Bump github.com/nwaples/rardecode/v2 from 2.1.1 to 2.2.0
Bumps [github.com/nwaples/rardecode/v2](https://github.com/nwaples/rardecode) from 2.1.1 to 2.2.0.
- [Commits](https://github.com/nwaples/rardecode/compare/v2.1.1...v2.2.0)

---
updated-dependencies:
- dependency-name: github.com/nwaples/rardecode/v2
  dependency-version: 2.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-21 09:31:33 +02:00
Matthias Bertschy
078d154ab8 chore: update runners to use ubuntu-large for improved performance
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-10-15 10:12:24 +02:00
Matthias Bertschy
cc9dcf827e Revert "use ubuntu-latest-16-cores runner for docker build"
This reverts commit 76943d05fb.
2025-10-15 10:01:39 +02:00
Matthias Bertschy
76943d05fb use ubuntu-latest-16-cores runner for docker build
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-10-13 10:23:07 +02:00
Matthias Bertschy
621ac111cb Merge pull request #1880 from kubescape/hostagent-block
fix: improve error handling in hostscanner pod validation
2025-10-12 11:52:16 +02:00
Matthias Bertschy
3f80bce811 fix: improve error handling in hostscanner pod validation
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-10-10 16:13:43 +02:00
Matthias Bertschy
cc6895fc50 chore: update syft action to use latest version
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-10-10 15:00:35 +02:00
Matthias Bertschy
7d9d8e4b59 Merge pull request #1879 from kubescape/fix-post-release
fix: post release action does not take tag from GITHUB_REF env var
2025-10-08 15:57:44 +02:00
Amir Malka
f8d4bf515d fix: post release action does not take tag from GITHUB_REF env var
Signed-off-by: Amir Malka <amirm@armosec.io>
2025-10-08 16:18:35 +03:00
Matthias Bertschy
774ebe4a5f bump python to 3.9
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-29 17:44:13 +02:00
Matthias Bertschy
45a07a8046 Merge pull request #1877 from kubescape/grype
migrate to grype v0.99.1
2025-09-17 11:35:30 +02:00
Matthias Bertschy
ff96edae4d use grype v0.99.1
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-17 10:11:19 +02:00
Matthias Bertschy
34b82cad27 Merge pull request #1875 from kkrypt0nn/master
fix: Don't run scan in installation script
2025-09-16 15:13:31 +02:00
Matthias Bertschy
1a4c979ab8 update golangci-lint config
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-16 13:54:23 +02:00
Matthias Bertschy
3481af4a5b bump golangci-lint action
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-16 11:48:02 +02:00
Ben Hirschberg
71dc7a702c Merge pull request #1876 from cx-anjali-deore/fix/policy-binding-param
Fixed issue #1800 : Added parameterNotFoundAction in spec.paramRef while creating policy binding
2025-09-15 10:17:52 +03:00
anjali-deore
6d92389285 Fixed issue 1800
Signed-off-by: anjali-deore <200181980+cx-anjali-deore@users.noreply.github.com>
2025-09-13 18:06:37 +05:30
Krypton
bd0be45c0b fix: Don't run scan in installation script
Signed-off-by: Krypton <root@krypton.ninja>
2025-09-12 19:54:31 +02:00
Amir Malka
7ebf078d0c fix post-release workflow (#1873)
Signed-off-by: Amir Malka <amirm@armosec.io>
2025-09-02 19:51:20 +03:00
Matthias Bertschy
1bd729cf83 fix go tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-02 14:45:12 +02:00
Matthias Bertschy
88b9b22bca Merge pull request #1857 from aadarsh-nagrath/default-matchers
feat: add default matchers option to image scanning
2025-09-02 14:25:29 +02:00
Matthias Bertschy
182162d521 gofmt
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-02 13:51:45 +02:00
Matthias Bertschy
1c02191bb1 Merge pull request #1866 from kubescape/tablewriter
replace olekukonko/tablewriter with jedib0t/go-pretty
2025-09-01 17:38:18 +02:00
Matthias Bertschy
ca66ccb33d replace olekukonko/tablewriter with jedib0t/go-pretty
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-01 16:38:42 +02:00
Matthias Bertschy
07eda20b88 Merge pull request #1869 from htsr/fix-imagescan-use-all-targets-exceptions
fix(imagescan): use all targets in exceptions
2025-09-01 16:29:04 +02:00
Matthias Bertschy
108c84d97d Merge pull request #1867 from cx-anjali-deore/feature/ListcontainerName
Issue 1817 fix: Show container name in Assisted remediation
2025-09-01 16:28:51 +02:00
Matthias Bertschy
35e7fa2b94 fix imports
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-09-01 15:49:31 +02:00
Hugo Thiessard
abb7917b29 fix(imagescan): use all targets in exceptions
Previously, kubescape only used the first target in scan image exceptions.
Added a test to verify the fix.

Signed-off-by: Hugo Thiessard <htsr@pm.me>
2025-09-01 15:05:00 +02:00
Matthias Bertschy
31ba56a0cf Merge pull request #1868 from kubescape/dependabot/go_modules/github.com/ulikunitz/xz-0.5.14
Bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14
2025-09-01 09:43:12 +02:00
dependabot[bot]
b3efe4d003 Bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14
Bumps [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz) from 0.5.12 to 0.5.14.
- [Commits](https://github.com/ulikunitz/xz/compare/v0.5.12...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 05:35:18 +00:00
anjali-deore
5faade2b66 Fixed test cases
Signed-off-by: anjali-deore <200181980+cx-anjali-deore@users.noreply.github.com>
2025-08-31 17:37:32 +05:30
Matthias Bertschy
79207f66be don't read services from configmap, use file
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-08-29 15:21:25 +02:00
anjali-deore
af39f9a7ef fix removed space
Signed-off-by: anjali-deore <200181980+cx-anjali-deore@users.noreply.github.com>
2025-08-29 15:31:35 +05:30
anjali-deore
482b7c1f67 fix 1817 ,code cleanup
Signed-off-by: anjali-deore <200181980+cx-anjali-deore@users.noreply.github.com>
2025-08-29 15:20:00 +05:30
anjali-deore
82e2fd0be2 fix issue 1817,Added Container Name in control scan output
Signed-off-by: anjali-deore <200181980+cx-anjali-deore@users.noreply.github.com>
2025-08-29 15:20:00 +05:30
Matthias Bertschy
6eec751027 Merge pull request #1864 from kubescape/dependabot/go_modules/httphandler/github.com/hashicorp/go-getter-1.7.9
Bump github.com/hashicorp/go-getter from 1.7.8 to 1.7.9 in /httphandler
2025-08-21 17:48:44 +02:00
dependabot[bot]
4a6480c8b4 Bump github.com/hashicorp/go-getter from 1.7.8 to 1.7.9
Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.8 to 1.7.9.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.8...v1.7.9)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-version: 1.7.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-21 17:14:35 +02:00
Matthias Bertschy
a51bfa4c3e Merge pull request #1863 from kubescape/new_fix/issue_1284
Issue 1284 fix: new approach implemented
2025-08-19 16:02:53 +02:00
Yehudah Tor
2a48af3c17 new approach of fix implemented
Signed-off-by: Yehudah Tor <yehudahtor@gmail.com>
2025-08-19 12:22:15 +03:00
Matthias Bertschy
ffeb4577e3 refactor output formatting in prettyprinter and related files
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-08-18 12:15:54 +02:00
Matthias Bertschy
b5c7422355 Merge pull request #1862 from kubescape/threshold
bump helm.sh/helm/v3 to 3.18.5
2025-08-18 11:07:42 +02:00
Matthias Bertschy
e41b5d77a0 bump helm.sh/helm/v3 to 3.18.5
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-08-18 10:28:34 +02:00
Matthias Bertschy
5afaae8847 Merge pull request #1860 from kubescape/threshold
return error on image when severity threshold exceeded
2025-08-18 10:22:19 +02:00
Matthias Bertschy
011fc0689d return error on image when severity threshold exceeded
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-08-14 14:38:59 +02:00
aadarsh-nagrath
db30020c95 feat: add default matchers option to image scanning
hey! added the default matchers option for image scanning as requested in #1838. now you can choose between stock matchers and CPE matchers when scanning images.

what's new:
- added --use-default-matchers flag to scan/image/patch commands
- true = stock matchers (default behavior)
- false = CPE matchers (more precise)

usage:
# use CPE matchers for more precise detection
kubescape scan image nginx:latest --use-default-matchers=false

# or in scan command
kubescape scan --scan-images --use-default-matchers=false

everything's backward compatible - existing code works exactly the same. just added the new option for folks who want more control over their vulnerability detection.

fixes #1838

Signed-off-by: aadarsh-nagrath <anagrath1@gmail.com>
2025-08-06 21:48:40 +05:30
Matthias Bertschy
c5341a356b fix prettyprinter test results
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-28 15:06:09 +02:00
Matthias Bertschy
85a7f57373 Merge pull request #1854 from kubescape/fixurls
fix docs URL in tests
2025-07-28 14:55:14 +02:00
Matthias Bertschy
cd9ebdf08f fix workflow permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-28 14:44:36 +02:00
Matthias Bertschy
bc602a78ab fix docs URL in tests
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-28 14:41:25 +02:00
Matthias Bertschy
a2361fd155 Merge pull request #1853 from kubescape/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.5
Bump github.com/containerd/containerd/v2 from 2.0.4 to 2.0.5
2025-07-28 14:26:07 +02:00
Matthias Bertschy
aa8d41fc2e fix workflow permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-28 14:18:31 +02:00
dependabot[bot]
5bd4beb41f Bump github.com/containerd/containerd/v2 from 2.0.4 to 2.0.5
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.4...v2.0.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.0.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 14:14:59 +02:00
Matthias Bertschy
dbf21dee37 Merge pull request #1852 from kubescape/dependabot/go_modules/helm.sh/helm/v3-3.17.4
Bump helm.sh/helm/v3 from 3.17.3 to 3.17.4
2025-07-28 14:13:32 +02:00
dependabot[bot]
be49d9b7be Bump helm.sh/helm/v3 from 3.17.3 to 3.17.4
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.17.3 to 3.17.4.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](https://github.com/helm/helm/compare/v3.17.3...v3.17.4)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-version: 3.17.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 14:02:05 +02:00
Matthias Bertschy
7a5699fba3 Merge pull request #1851 from kubescape/dependabot/go_modules/github.com/cloudflare/circl-1.6.1
Bump github.com/cloudflare/circl from 1.5.0 to 1.6.1
2025-07-28 13:48:28 +02:00
dependabot[bot]
1f8afecea8 Bump github.com/cloudflare/circl from 1.5.0 to 1.6.1
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.5.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-version: 1.6.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 13:33:52 +02:00
Matthias Bertschy
3ebb1d749e Merge pull request #1850 from kubescape/dependabot/go_modules/httphandler/github.com/go-viper/mapstructure/v2-2.3.0
Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 in /httphandler
2025-07-28 13:32:17 +02:00
dependabot[bot]
f80c9d947d Bump github.com/go-viper/mapstructure/v2 in /httphandler
Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 13:18:52 +02:00
Matthias Bertschy
03b76ff4aa Merge pull request #1833 from kubescape/dependabot/go_modules/github.com/open-policy-agent/opa-1.4.0
Bump github.com/open-policy-agent/opa from 1.3.0 to 1.4.0
2025-07-28 13:06:52 +02:00
dependabot[bot]
01531b6276 Bump github.com/open-policy-agent/opa from 1.3.0 to 1.4.0
Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-policy-agent/opa/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/open-policy-agent/opa
  dependency-version: 1.4.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-28 12:20:18 +02:00
Ben Hirschberg
aedfe1c4c0 Merge pull request #1849 from kubescape/fix/addon-urls
added urls hub.armo --> kubescape.io
2025-07-27 14:19:34 +03:00
Yehudah Tor
d2bedc1d2b added urls
Signed-off-by: Yehudah Tor <yehudahtor@gmail.com>
2025-07-27 13:50:47 +03:00
Ben Hirschberg
35288e7b85 Merge pull request #1846 from kubescape/fix/update-links
Fix/update links
2025-07-27 10:01:27 +03:00
Matthias Bertschy
cd046fa695 fix buildnumber test
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-26 11:08:43 +02:00
Matthias Bertschy
407b8be08f Merge pull request #1848 from kubescape/fixgrype
close grype DB at the very end of processing
2025-07-25 11:23:56 +02:00
Matthias Bertschy
b211fe9148 Merge pull request #1847 from kubescape/fixversion
do not fail version if update info cannot be fetched
2025-07-25 11:23:24 +02:00
Matthias Bertschy
525e51d68e close grype DB at the very end of processing
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-25 09:50:10 +02:00
Matthias Bertschy
daabd6c81a do not fail version if update info cannot be fetched
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-07-25 08:48:27 +02:00
Yehudah Tor
5b351d5eec Done URL ref's before problematic ones
Signed-off-by: Yehudah Tor <yehudahtor@gmail.com>
2025-07-24 12:11:31 +03:00
Yehudah Tor
a5b607ae2e All controls updated
Signed-off-by: Yehudah Tor <yehudahtor@gmail.com>
2025-07-24 11:12:18 +03:00
Yehudah Tor
fec51b00ba getting started kubescape.io control links updated
Signed-off-by: Yehudah Tor <yehudahtor@gmail.com>
2025-07-23 15:16:41 +03:00
Amir Malka
4f9809eec1 fix: control-plane node taints check (#1843)
Signed-off-by: Amir Malka <amirm@armosec.io>
2025-07-15 11:06:09 +03:00
Matthias Bertschy
c0c25c3430 Merge pull request #1841 from kubescape/submit
check scanInfo.Submit in HandleResults to not submit by default
2025-06-30 09:09:05 +02:00
Matthias Bertschy
6ed3e408be check scanInfo.Submit in HandleResults to not submit by default
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-06-30 08:16:41 +02:00
Matthias Bertschy
6042818a71 use go 1.24
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-06-24 16:31:45 +02:00
Matthias Bertschy
b37c20aed9 fix workflow permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-06-24 16:01:11 +02:00
Matthias Bertschy
3de8204c43 fix workflow permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-06-24 15:59:27 +02:00
Ben Hirschberg
d5bd3708b8 Merge pull request #1836 from slashben/feature/mcpserver-v1
Feature/mcpserver v1
2025-06-24 16:29:16 +03:00
Ben
2bd686131e Incorporating review
Signed-off-by: Ben <ben@armosec.io>
2025-06-10 14:32:26 +03:00
Ben
1ea4e0c304 Add configuration scan tools and resource handling
Implemented two new tools: 'list_configuration_security_scan_manifests' for listing available configuration scan manifests and 'get_configuration_security_scan_manifest' for retrieving details of a specific manifest. Added a resource template for configuration manifests and integrated these tools into the mcpserver.

Signed-off-by: Ben <ben@armosec.io>
2025-06-09 09:11:28 +03:00
Matthias Bertschy
b3251306d0 Merge pull request #1837 from ian-fox/master
Make a second sigint terminate kubescape immediately
2025-06-03 12:54:02 +02:00
Ian Fox
91ecdaba4e Make a second sigint terminate immediately
Right now, sending a sigint will start a graceful shutdown, which can take quite a while.
By calling stop() in the signal handler it unregisters the handler so that a subsequent
sigint received during a graceful shutdown will kill the process immediately.

Signed-off-by: Ian Fox <code@whatthefox.dev>
2025-06-02 19:12:45 +02:00
Matthias Bertschy
fa05dcd00d go.mod massaging
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-05-23 16:02:15 +02:00
Ben
1c2c928732 Failing build
Signed-off-by: Ben <ben@armosec.io>
2025-05-23 15:13:22 +03:00
Ben
69ac490006 Failing build
Signed-off-by: Ben <ben@armosec.io>
2025-05-23 15:13:12 +03:00
Matthias Bertschy
b67b9f3af2 Merge pull request #1835 from pixel365/cancel
Ensure context cancellation on command execution failure
2025-05-16 21:20:16 +02:00
Ruslan Semagin
628ed4a374 Ensure context cancellation on command execution failure
Signed-off-by: Ruslan Semagin <pixel.365.24@gmail.com>
2025-05-16 10:11:06 +03:00
Matthias Bertschy
a6fe34b466 add workflow_dispatch to pr scanner
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-05-02 16:36:27 +02:00
Matthias Bertschy
2e9406d96a Merge pull request #1828 from rash1411/patch-1
Update dir.go
2025-04-29 21:44:09 +02:00
Matthias Bertschy
6b1bf07f7f Merge pull request #1827 from shangchengbabaiban/master
fix: Fix stdin restoration in TestUserConfirmed
2025-04-29 21:40:30 +02:00
Matthias Bertschy
318c2c7ae6 Merge pull request #1829 from kubescape/dependabot/go_modules/golang.org/x/net-0.38.0
Bump golang.org/x/net from 0.37.0 to 0.38.0
2025-04-28 14:19:13 +02:00
dependabot[bot]
45f60b6fe0 Bump golang.org/x/net from 0.37.0 to 0.38.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.37.0 to 0.38.0.
- [Commits](https://github.com/golang/net/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 14:03:44 +02:00
rash1411
20557bc721 Update dir.go
Fix: Correct runtime.Caller usage and handle error in CurrentDir()

- Changed runtime.Caller(1) to runtime.Caller(0) to correctly fetch the current file's directory.
- Added proper check for the 'ok' value returned by runtime.Caller.
- Improved robustness by panicking if runtime information retrieval fails.


Signed-off-by: rash1411 <107741585+rash1411@users.noreply.github.com>
2025-04-27 01:29:04 +05:30
shangchengbabaiban
d8bfb27bc3 fix: Fix stdin restoration in TestUserConfirmed
Signed-off-by: shangchengbabaiban <shuang.cui@live.cn>
2025-04-19 10:51:09 +08:00
Matthias Bertschy
9776691816 Merge pull request #1824 from kubescape/dependabot/go_modules/helm.sh/helm/v3-3.17.3
Bump helm.sh/helm/v3 from 3.14.4 to 3.17.3
2025-04-15 12:41:19 +02:00
dependabot[bot]
80e419df24 Bump helm.sh/helm/v3 from 3.14.4 to 3.17.3
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.14.4 to 3.17.3.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](https://github.com/helm/helm/compare/v3.14.4...v3.17.3)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-version: 3.17.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-15 12:22:19 +02:00
Matthias Bertschy
143f831f5b Merge pull request #1822 from kubescape/mergelabels
merge labels and annotations in RetryOnConflict
2025-04-14 16:26:47 +02:00
Matthias Bertschy
a4897304e8 merge labels and annotations in RetryOnConflict
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-04-14 15:36:34 +02:00
Matthias Bertschy
80d1165e2c Merge pull request #1820 from kubescape/opav1
upgrade open-policy-agent to 1.x
2025-04-14 14:13:23 +02:00
Matthias Bertschy
31ed7d5160 upgrade open-policy-agent to 1.x
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-04-10 17:17:08 +02:00
Matthias Bertschy
d62e9ce207 Merge pull request #1814 from pixel365/tests
test: increase test coverage
2025-04-07 09:17:27 +02:00
Ruslan Semagin
3b10443ff5 fix: goimports
Signed-off-by: Ruslan Semagin <pixel.365.24@gmail.com>
2025-04-01 12:26:15 +03:00
Ruslan Semagin
218e3914b1 test: increase test coverage
Signed-off-by: Ruslan Semagin <pixel.365.24@gmail.com>
2025-04-01 10:12:35 +03:00
Matthias Bertschy
2b07fbe782 Merge pull request #1813 from kubescape/merge
check for nil map in merge methods
2025-03-31 11:18:05 +02:00
Matthias Bertschy
0655d0496b check for nil map in merge methods
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-28 12:10:38 +01:00
Matthias Bertschy
02bf31fbc9 Merge pull request #1812 from kubescape/dependabot/go_modules/github.com/golang-jwt/jwt/v5-5.2.2
Bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2
2025-03-28 11:03:59 +01:00
dependabot[bot]
4d8a3f51e3 Bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2
Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-28 10:30:02 +01:00
Matthias Bertschy
43d29f7b8b Merge pull request #1811 from kubescape/prerequisites
feat: enhance prerequisites UI with new review-values and improved pr…
2025-03-24 12:44:42 +01:00
David Alima
ee0d4cba98 feat: enhance prerequisites UI with new review-values and improved prerequisites report
Signed-off-by: David Alima <davida@armosec.io>
2025-03-24 13:10:58 +02:00
Matthias Bertschy
d860c0234a Merge pull request #1809 from kubescape/dependabot/go_modules/golang.org/x/net-0.36.0
Bump golang.org/x/net from 0.33.0 to 0.36.0
2025-03-20 13:35:08 +01:00
Matthias Bertschy
f13ded61bf Bump github.com/containerd/containerd to 1.7.27
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-20 13:05:17 +01:00
dependabot[bot]
fe8fc700f4 Bump golang.org/x/net from 0.33.0 to 0.36.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-20 09:59:07 +00:00
Matthias Bertschy
47b670637b Merge pull request #1808 from kubescape/prereq
updating prerequisites to support custom kubeconfig
2025-03-19 09:37:57 +01:00
Matthias Bertschy
97c83a652b updating prerequisites to support custom kubeconfig
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-18 10:02:17 +01:00
Matthias Bertschy
a089831720 upload everything in dist
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-10 10:32:00 +01:00
Matthias Bertschy
e4f1720a0c bump goreleaser action in the other file too
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-10 09:52:42 +01:00
Matthias Bertschy
233eb2134c bump goreleaser action
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-10 09:19:48 +01:00
Matthias Bertschy
06da926455 Merge pull request #1806 from kubescape/goreleaser
generate checksums for all artifacts
2025-03-10 08:56:35 +01:00
Amit Schendel
37f6193fe0 Merge pull request #1807 from kubescape/Bump-license-date
Update README.md
2025-03-09 17:08:09 +02:00
Amit Schendel
27ac036b7d Update README.md
Signed-off-by: Amit Schendel <58078857+amitschendel@users.noreply.github.com>
2025-03-09 17:04:32 +02:00
Matthias Bertschy
321d335b39 generate checksums for all artifacts
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-09 12:37:21 +01:00
Matthias Bertschy
91b7d8fc2b Merge pull request #1803 from kubescape/dependabot/go_modules/github.com/go-jose/go-jose/v3-3.0.4
Bump github.com/go-jose/go-jose/v3 from 3.0.3 to 3.0.4
2025-03-04 10:38:44 +01:00
dependabot[bot]
2b28911db0 Bump github.com/go-jose/go-jose/v3 from 3.0.3 to 3.0.4
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-03-04 09:28:14 +01:00
Amir Malka
667e5e8258 fix score calculation for framework with all controls in status irrelevant (#1802)
Signed-off-by: Amir Malka <amirm@armosec.io>
2025-03-03 15:20:14 +02:00
Matthias Bertschy
728b341048 Merge pull request #1797 from kubescape/prereq
update prerequisites command
2025-02-26 11:51:42 +01:00
Matthias Bertschy
75b295d579 update prerequisites command
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-26 11:20:33 +01:00
Matthias Bertschy
75298eabf2 Merge pull request #1796 from kubescape/dependabot/go_modules/httphandler/github.com/go-jose/go-jose/v4-4.0.5
Bump github.com/go-jose/go-jose/v4 from 4.0.2 to 4.0.5 in /httphandler
2025-02-25 08:45:31 +01:00
dependabot[bot]
2458f2ceb9 Bump github.com/go-jose/go-jose/v4 from 4.0.2 to 4.0.5
Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.0.2 to 4.0.5.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v4.0.2...v4.0.5)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-25 07:58:42 +01:00
Amir Malka
f57948ad97 deprecate control name in exception policies (#1795)
* deprecate control name in posture exception policies

Signed-off-by: Amir Malka <amirm@armosec.io>

* deprecate control name in posture exception policies

Signed-off-by: Amir Malka <amirm@armosec.io>

* deprecate control name in posture exception policies

Signed-off-by: Amir Malka <amirm@armosec.io>

* deprecate control name in posture exception policies

Signed-off-by: Amir Malka <amirm@armosec.io>

---------

Signed-off-by: Amir Malka <amirm@armosec.io>
2025-02-20 10:27:27 +02:00
Matthias Bertschy
d0befc5f16 Merge pull request #1792 from kubescape/colors
removing enable/disable colors, as not compatible with all loggers
2025-02-18 12:11:40 +01:00
Matthias Bertschy
5d4bd2e94e removing enable/disable colors, as not compatible with all loggers
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-18 11:38:47 +01:00
Matthias Bertschy
ae37fdc295 fix go tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-14 16:19:42 +01:00
Matthias Bertschy
3dd95ff3a3 Merge pull request #1791 from kubescape/prereq
update prerequisites
2025-02-14 16:12:03 +01:00
Matthias Bertschy
daadb5b804 update prerequisites
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-14 16:10:31 +01:00
Matthias Bertschy
d250017faf Merge pull request #1790 from pixel365/err
fix: add error handling and context propagation
2025-02-12 10:56:03 +01:00
Ruslan Semagin
835bcbeb12 fix: format imports with goimports
Signed-off-by: Ruslan Semagin <pixel.365.24@gmail.com>
2025-02-12 12:15:14 +03:00
Ruslan Semagin
2e4f7c4477 fix: add error handling and context propagation
Signed-off-by: Ruslan Semagin <pixel.365.24@gmail.com>
2025-02-12 09:02:01 +03:00
Matthias Bertschy
66bf93eb0c Merge pull request #1789 from pixel365/ctx
Refactor: propagate context from main to avoid redundant context creation
2025-02-11 21:27:48 +01:00
Matthias Bertschy
3a036ed0e3 remove test resources saved by accident
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-11 21:26:26 +01:00
Ruslan Semagin
fe7dad4560 Refactor: propagate context from main to avoid redundant context creation
- Introduced a single context in main() to handle interrupt signals (os.Interrupt, syscall.SIGTERM).
- Removed repetitive context creation in the program by reusing the propagated context.
- Improved code readability and maintainability by centralizing context management.
- Ensured consistent handling of graceful shutdown across the program.

Signed-off-by: Ruslan Semagin <pixel.365.24@gmail.com>
2025-02-11 19:52:48 +03:00
Matthias Bertschy
fb36b09f3a remove mv kubescape arm64 binary step
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-11 09:49:17 +01:00
Matthias Bertschy
e71b0c75a9 fix downloaded artifacts path
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-11 08:55:43 +01:00
Matthias Bertschy
d615099ce1 try fixing download-artifacts action for release
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-11 07:42:30 +01:00
Matthias Bertschy
f265b91939 Merge pull request #1788 from kubescape/sarif
do not skip on location resolver error
2025-02-10 13:40:59 +01:00
Matthias Bertschy
825694ade1 do not skip on location resolver error
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-10 10:25:44 +01:00
Matthias Bertschy
979a30aea7 Merge pull request #1591 from Sanskarzz/scanapiexception
added support for exception rules in Scan API ( As a HTTP request)
2025-02-07 13:32:42 +01:00
Matthias Bertschy
39c4aa4faa Merge pull request #1568 from VaibhavMalik4187/feature-exceptions
Feature: Added exceptions flag in scan image cmd
2025-02-07 12:40:24 +01:00
Matthias Bertschy
475b672a7a add fixed grypeDB for tests
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-07 12:34:11 +01:00
Matthias Bertschy
815c87b532 implement reviews from DW
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-07 12:16:35 +01:00
Sanskarzz
82120f9d31 added support for exception rules
Signed-off-by: Sanskarzz <sanskar.gur@gmail.com>
2025-02-07 12:15:56 +01:00
VaibhavMalik4187
0545818f82 Added tests and improvements for image exceptions
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2025-02-07 10:26:53 +01:00
VaibhavMalik4187
046da1940c Added support for targets in image exceptions
This commit introduces the ability to specify targets in image
exceptions. Each target will have the following 4 attributes:

1. Registry
2. Organization
3. ImageName
4. ImageTag

These attributes will be used to match against the canonical image name
of the image to be scanned. The vulnerabilites and the severities
specified in the VulnerabilitiesIgnorePolicy object will be considered
only if the image to be scanned matches the targets specified for that
policy. Regular expressions can also be used to specify the image
attributes.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2025-02-07 10:26:53 +01:00
VaibhavMalik4187
a31154897f Added support for severity exceptions in imagescan
This commit add relevant functions to support severity exceptions during
image scan.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2025-02-07 10:26:53 +01:00
VaibhavMalik4187
199c57be30 WIP: Load image exceptions from file
Added initial commit to start loading image exceptions from json files.

Currently, it supports vulnerability exceptions using their CVE-IDs.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2025-02-07 10:26:53 +01:00
VaibhavMalik4187
7d55c79f11 Feature: Added exceptions flag in scan image cmd
This commit introduces the "exceptions" flag in the scan image command.
Users can pass a list of vulnerabilities they ignore while scanning an
image using this flag. Also added tests for the same.

Fixes: https://github.com/kubescape/kubescape/issues/1564

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2025-02-07 10:26:53 +01:00
Matthias Bertschy
ee76364371 fix scorecard-action version
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-07 09:23:28 +01:00
Matthias Bertschy
4f2c7ac1de Merge pull request #1787 from kubescape/bump
bump all CI actions
2025-02-07 09:09:44 +01:00
Matthias Bertschy
00340827be bump all CI actions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-07 08:00:19 +01:00
Matthias Bertschy
708fe64240 Merge pull request #1786 from Fernando-hub527/refactor/maroto-version-v2
Refactor: maroto version v2
2025-02-07 07:33:34 +01:00
Fernando-hub527
8985bbe3a9 refactor: update Maroto configuration file location
Signed-off-by: Fernando-hub527 <fernandocoelhosaraivanando@gmail.com>
2025-02-06 18:07:57 -03:00
Matthias Bertschy
1ffca5648e delete TableObject.getSeverityColor to please CI
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-02-06 07:56:07 +01:00
Fernando-hub527
76b1ecb022 refactor: create a method that returns the pdf row
Return a struct with the data for ease of use

Signed-off-by: Fernando-hub527 <fernandocoelhosaraivanando@gmail.com>
2025-02-05 21:52:50 -03:00
Fernando-hub527
fc69a3692e refactor: remove unused code
Signed-off-by: Fernando-hub527 <fernandocoelhosaraivanando@gmail.com>
2025-02-05 21:47:28 -03:00
Fernando-hub527
e159458129 test:validate creation of report pdf
Signed-off-by: Fernando-hub527 <fernandocoelhosaraivanando@gmail.com>
2025-02-05 21:45:01 -03:00
Fernando-hub527
b259f117ff refactor: create a report template with maroto/v2
Separate template creation from application logic

Signed-off-by: Fernando-hub527 <fernandocoelhosaraivanando@gmail.com>
2025-02-05 21:36:39 -03:00
Fernando-hub527
13cf34bffd refactor: update Maroto version to v2
Signed-off-by: Fernando-hub527 <fernandocoelhosaraivanando@gmail.com>
2025-02-05 21:31:22 -03:00
Matthias Bertschy
0300fee38b bump actions/download-artifact@v4
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-31 16:38:01 +01:00
Matthias Bertschy
d61d641e81 bump actions/upload-artifact@v4
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-31 16:09:16 +01:00
Matthias Bertschy
2added0f7c use go 1.23, disable cache
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-31 16:06:13 +01:00
Matthias Bertschy
b6f6573ed8 Merge pull request #1785 from kubescape/sarif
fix helm detection in sarif printer
2025-01-31 16:04:36 +01:00
Matthias Bertschy
4215771134 fix helm detection in sarif printer
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-31 15:23:15 +01:00
Amit Schendel
fd37446e1b Merge pull request #1784 from kubescape/feature/incubating-logo
Changing README of Kubescape from Sandbox to Incubating
2025-01-27 14:01:09 +02:00
Amit Schendel
351498aac5 Changing README of Kubescape from Sandbox to Incubating
Signed-off-by: Amit Schendel <amitschendel@gmail.com>
2025-01-27 13:47:16 +02:00
Eng Zer Jun
2005010568 Replace golang.org/x/exp/slices with slices from stdlib (#1783) 2025-01-17 20:51:08 +02:00
Matthias Bertschy
e16c4cc9b4 fix go.mod for httphandler
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-16 15:20:58 +01:00
Matthias Bertschy
544ba9831a Merge pull request #1782 from kubescape/prereq
add prerequisites command
2025-01-16 14:50:28 +01:00
Matthias Bertschy
b6c919feb1 add prerequisites command
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-16 14:10:40 +01:00
Matthias Bertschy
1c3b2831a2 Merge pull request #1781 from kubescape/add-trigger-indication-in-posture-report
add trigger by indication in posture report
2025-01-09 16:12:43 +01:00
Amit Schendel
8a19a73bb1 Update b-binary-build-and-e2e-tests.yaml (#1761)
Signed-off-by: Amit Schendel <58078857+amitschendel@users.noreply.github.com>
2025-01-09 17:01:51 +02:00
Amir Malka
d966b0acbc update opa-utils
Signed-off-by: Amir Malka <amirm@armosec.io>
2025-01-09 16:35:53 +02:00
Amir Malka
14ffe35437 add trigger by indication in posture report
Signed-off-by: Amir Malka <amirm@armosec.io>
2025-01-09 16:13:29 +02:00
Matthias Bertschy
985d72e5fb Merge pull request #1780 from kubescape/airgap
Airgap support
2025-01-09 14:00:50 +01:00
Matthias Bertschy
70a9380966 fix go imports
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-09 12:14:56 +01:00
Matthias Bertschy
f706d126f5 fix error in log about failed resource update
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-09 11:52:34 +01:00
Matthias Bertschy
600f19406e enable offline mode with env KS_OFFLINE
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-09 10:33:19 +01:00
Matthias Bertschy
d7ebf3239b include artifacts in httphandler image
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-09 09:44:22 +01:00
Matthias Bertschy
5e0b25b04a update go-git
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2025-01-09 09:42:36 +01:00
Ben Hirschberg
98fe2347fa Merge pull request #1779 from kubescape/roadmap-deprecation-message
Deprecation of the roadmap.md in this repo
2025-01-06 13:53:47 +02:00
Ben Hirschberg
9b22d3284e Deprecation of the roadmap.md in this repo
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2025-01-06 13:24:55 +02:00
Matthias Bertschy
9544e9cd66 Merge pull request #1778 from kubescape/bump
bump vulnerable deps
2024-12-20 17:04:20 +01:00
Matthias Bertschy
1ed1bb11f2 bump vulnerable deps
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-12-20 16:31:50 +01:00
Matthias Bertschy
b8ca1fcbce Merge pull request #1766 from Oshratn/inc_tasks
Update of README
2024-12-16 11:39:20 +01:00
Matthias Bertschy
326a3e4c63 Merge pull request #1776 from kubescape/dependabot/go_modules/golang.org/x/crypto-0.31.0
Bump golang.org/x/crypto from 0.27.0 to 0.31.0
2024-12-13 17:04:34 +01:00
dependabot[bot]
b348acd291 Bump golang.org/x/crypto from 0.27.0 to 0.31.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.27.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.27.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 15:31:42 +00:00
Matthias Bertschy
4fc3eacf7b Merge pull request #1775 from kubescape/dependabot/go_modules/httphandler/golang.org/x/crypto-0.31.0
Bump golang.org/x/crypto from 0.27.0 to 0.31.0 in /httphandler
2024-12-13 16:29:25 +01:00
dependabot[bot]
d6030a9c03 Bump golang.org/x/crypto from 0.27.0 to 0.31.0 in /httphandler
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.27.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.27.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 14:18:38 +00:00
Ben Hirschberg
e87bf7b723 Update maintainers in SECURITY-INSIGHTS.yml (#1774)
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-12-11 17:58:13 +02:00
Matthias Bertschy
4ef0b27ccf Merge pull request #1773 from kubescape/debug
add debug log on resource fetch with count
2024-12-11 09:51:58 +01:00
Matthias Bertschy
219582b92a add debug log on resource fetch with count
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-12-11 07:35:36 +01:00
Matthias Bertschy
07ed8c61f1 Merge pull request #1769 from needsure/master
chore: fix some function name in comment
2024-12-06 07:15:10 +01:00
needsure
c585abc21a chore: fix some function name in comment
Signed-off-by: needsure <qinzhipeng@outlook.com>
2024-12-06 13:41:14 +08:00
Matthias Bertschy
08696c583a Merge pull request #1767 from kubescape/statis
use distroless static for kubescape-cli image
2024-12-03 14:13:05 +01:00
Matthias Bertschy
7d94dc74bb use distroless static for kubescape-cli image
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-12-03 13:36:11 +01:00
Oshrat Nir
570369a66f Merge branch 'master' into inc_tasks
Signed-off-by: Oshrat Nir <45561829+Oshratn@users.noreply.github.com>
2024-12-02 16:50:35 +02:00
Oshrat Nir
97f24920e8 conflict resolution
Signed-off-by: Oshrat Nir <oshratn@armosec.io>
2024-12-02 16:44:58 +02:00
Oshrat Nir
f57305280f Update of README
Signed-off-by: Oshrat Nir <oshratn@armosec.io>
2024-12-02 16:27:46 +02:00
Matthias Bertschy
53c134cbc3 Merge pull request #1763 from kubescape/update-governance-files-c2834f57
Update governance files
2024-11-26 11:42:20 +01:00
Ben Hirschberg
3c3a1838e3 Update SECURITY.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:26 +02:00
Ben Hirschberg
adfd09a9d4 Update MAINTAINERS.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:24 +02:00
Ben Hirschberg
43ac47ec51 Update GOVERNANCE.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:23 +02:00
Ben Hirschberg
ec715ab68b Update CONTRIBUTING.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:21 +02:00
Ben Hirschberg
fbff5873f7 Add COMMUNITY.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:20 +02:00
Ben Hirschberg
a81eab0a1a Update CODE_OF_CONDUCT.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:18 +02:00
Ben Hirschberg
cfc52856b3 Update ADOPTERS.md
Signed-off-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2024-11-26 11:39:16 +02:00
Matthias Bertschy
5707d7f7e4 Merge pull request #1760 from slashben/add-reg-print
Implementing capability to print out the "print" statements of the rego
2024-11-21 09:24:22 +01:00
Ben
4f3ef49f99 Implementing capability to print out the "print" statements of the rego
Signed-off-by: Ben <ben@armosec.io>
2024-11-20 00:10:18 +02:00
Matthias Bertschy
a9ac880356 Merge pull request #1758 from kubescape/bug_fix/repo_scan
fix the repo scan got stuck bug
2024-11-19 15:42:59 +01:00
Matthias Bertschy
761d4c6ff4 gofmt and try to make linter happy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-11-19 15:10:37 +01:00
Matthias Bertschy
bbb2aafc7e try to override GITHUB_REF for krew publisher
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-11-19 14:49:49 +01:00
jnathangreeg
7735087937 fix the repo scan get stucked bug
Signed-off-by: jnathangreeg <jonathang@armosec.io>
2024-11-19 15:13:31 +02:00
Matthias Bertschy
5b9c6491de fix mod tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-11-18 10:34:28 +01:00
Matthias Bertschy
b0e3744140 Merge pull request #1756 from kubescape/bug_fix/repo_scan
bump opa-utils version to fix apiVersion check
2024-11-18 10:09:07 +01:00
Matthias Bertschy
0451cdb345 Merge pull request #1757 from kubescape/krew
bump krew publish action
2024-11-18 09:39:31 +01:00
Matthias Bertschy
4546465f4a bump krew publish action
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-11-18 09:38:22 +01:00
Matthias Bertschy
52c564b2a4 Merge pull request #1749 from craigbox/doc-updates
some easy doc fixes
2024-11-18 07:14:57 +01:00
Craig Box
0abc81003e remove git2go
Signed-off-by: Craig Box <craig.box@gmail.com>
2024-11-18 15:31:49 +13:00
Craig Box
817d4902ff fix David's Url
Signed-off-by: Craig Box <craig.box@gmail.com>
2024-11-18 15:27:46 +13:00
Craig Box
5553a1adf0 some easy doc fixes
Signed-off-by: Craig Box <craig.box@gmail.com>
2024-11-18 15:26:33 +13:00
jnathangreeg
e95352d31e switch runner
Signed-off-by: jnathangreeg <jonathang@armosec.io>
2024-11-17 13:20:02 +02:00
jnathangreeg
5655051a95 bump opa-utils version
Signed-off-by: jnathangreeg <jonathang@armosec.io>
2024-11-17 12:13:23 +02:00
Matthias Bertschy
90c359533f override docker/docker upgrade
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-11-12 14:46:29 +01:00
Matthias Bertschy
7013d83aa8 Merge pull request #1754 from kubescape/dependabot/go_modules/httphandler/github.com/golang-jwt/jwt/v4-4.5.1
Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 in /httphandler
2024-11-12 11:35:37 +01:00
dependabot[bot]
c4935671fe Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 in /httphandler
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-12 10:32:57 +00:00
Matthias Bertschy
e67ef1c54d Merge pull request #1752 from kubescape/bug_fix/repo_scan
Add a second condition in getFilesFromTree to ensure we are scanning the correct path
2024-11-12 11:20:47 +01:00
Matthias Bertschy
5d6b9a5e83 Merge pull request #1753 from kubescape/dependabot/go_modules/github.com/golang-jwt/jwt/v4-4.5.1
Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1
2024-11-12 11:03:11 +01:00
dependabot[bot]
a6752a5a6d Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-12 08:33:28 +00:00
jnathangreeg
6f47f8dae0 adding a second term for getFilesFromTree for makeing sure we scaning the right path
Signed-off-by: jnathangreeg <jonathang@armosec.io>
2024-11-11 19:29:22 +02:00
Matthias Bertschy
d82e8daa25 Add CoC link to GOVERNANCE.md
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-10-28 16:34:00 +01:00
Matthias Bertschy
1cad446fe6 Merge pull request #1742 from kubescape/dependabot/go_modules/httphandler/github.com/containers/common-0.60.4
Bump github.com/containers/common from 0.59.0 to 0.60.4 in /httphandler
2024-10-03 07:57:55 +02:00
dependabot[bot]
12c6f34fe7 Bump github.com/containers/common from 0.59.0 to 0.60.4 in /httphandler
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.59.0 to 0.60.4.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.59.0...v0.60.4)

---
updated-dependencies:
- dependency-name: github.com/containers/common
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-03 05:21:42 +00:00
Matthias Bertschy
79c2dd9a2b Merge pull request #1741 from kubescape/bump
bump opa
2024-09-30 18:00:01 +02:00
Matthias Bertschy
f64d5a03af bump opa and go-logger
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-09-30 17:40:38 +02:00
Matthias Bertschy
e27d1581f1 Merge pull request #1736 from comrumino/master
EKS Support error: failed to get cloud data
2024-09-25 08:15:58 +02:00
James Stronz
99985e3235 Bumped k8s-interface version to v0.0.174, the latest release
Signed-off-by: James Stronz <comrumino@archstrike.org>
2024-09-24 23:44:39 -05:00
comrumino
27782afeac Upgraded aws module dependencies to resolve the error failed to get cloud data. resourceKind: ClusterDescribe; error: not found, ResolveEndpointV2. This error is a known issue regarding incompatible service module versions. Refer to https://github.com/aws/aws-sdk-go-v2/issues/2370#issuecomment-1953308268 for more details.
Signed-off-by: comrumino <comrumino@archstrike.org>
2024-09-19 12:21:43 -05:00
Matthias Bertschy
0e846b2dc5 Merge pull request #1732 from kubescape/grpc
force grpc
2024-09-06 15:43:47 +02:00
Matthias Bertschy
45fb0f207e try to move post-release steps into main workflow
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-09-06 12:43:17 +02:00
Matthias Bertschy
b7c91c238d force grpc
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-09-04 21:57:00 +02:00
Matthias Bertschy
76635a0705 Merge pull request #1730 from kubescape/bump
also bump workflows to 1.23
2024-08-26 08:49:44 +02:00
Matthias Bertschy
c91d69e7fd also bump workflows to 1.23
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-08-21 13:33:02 +02:00
Matthias Bertschy
5fd7096d67 Merge pull request #1729 from kubescape/bump
update to go 1.23 and base image to debian12
2024-08-21 13:04:21 +02:00
Matthias Bertschy
f4189cb5ec update to go 1.23 and base image to debian12
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-08-21 12:49:52 +02:00
Matthias Bertschy
278ca5b8ae Merge pull request #1728 from kubescape/dependabot/go_modules/httphandler/github.com/docker/docker-26.1.5incompatible
Bump github.com/docker/docker from 26.1.4+incompatible to 26.1.5+incompatible in /httphandler
2024-08-21 12:26:07 +02:00
dependabot[bot]
729efcb8c3 Bump github.com/docker/docker in /httphandler
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.1.4+incompatible to 26.1.5+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.1.4...v26.1.5)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-21 10:24:57 +00:00
Matthias Bertschy
406031d4e9 Merge pull request #1726 from kubescape/dependabot/go_modules/github.com/docker/docker-26.1.5incompatible
Bump github.com/docker/docker from 26.1.4+incompatible to 26.1.5+incompatible
2024-08-21 12:22:24 +02:00
Matthias Bertschy
9e1d0d2cd6 Merge pull request #1722 from kubescape/dependabot/go_modules/httphandler/github.com/docker/docker-26.1.4incompatible
Bump github.com/docker/docker from 26.1.0+incompatible to 26.1.4+incompatible in /httphandler
2024-08-21 12:21:35 +02:00
dependabot[bot]
f3e78f9408 Bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.1.4+incompatible to 26.1.5+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.1.4...v26.1.5)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-21 05:56:42 +00:00
dependabot[bot]
eea4cc0b49 Bump github.com/docker/docker in /httphandler
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.1.0+incompatible to 26.1.4+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.1.0...v26.1.4)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-06 19:43:32 +00:00
Matthias Bertschy
1127f44c10 Merge pull request #1723 from kubescape/dependabot/go_modules/github.com/docker/docker-26.1.4incompatible
Bump github.com/docker/docker from 26.1.0+incompatible to 26.1.4+incompatible
2024-08-06 21:41:28 +02:00
dependabot[bot]
377509fab8 Bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 26.1.0+incompatible to 26.1.4+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v26.1.0...v26.1.4)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-06 15:39:44 +00:00
Matthias Bertschy
c21e2f3147 Merge pull request #1719 from maanugh/krew/release
chore: improve the publishing workflows for krew
2024-08-04 22:17:24 +02:00
Kiraat
0b4c5db939 Update .github/workflows/04-publish-krew-plugin.yaml
Co-authored-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Kiraat <137809273+maanugh@users.noreply.github.com>
2024-07-26 15:28:55 +05:30
maanugh
6d490fc501 chore: improve the publishing workflows for krew
Signed-off-by: maanugh <manusin46@gmail.com>
2024-07-26 15:20:48 +05:30
Matthias Bertschy
dbb71ba066 Merge pull request #1718 from kubescape/fixfix
fix include/exclude NS for SA discovered via CRB
2024-07-24 07:36:27 +02:00
Matthias Bertschy
d5b8532e40 fix include/exclude NS for SA discovered via CRB
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-07-23 18:42:01 +02:00
Matthias Bertschy
db396b26f8 Merge pull request #1717 from kubescape/documentation_ugrades
Documentation ugrades
2024-07-15 16:49:07 +02:00
idohu
1242259331 fix png link
Signed-off-by: idohu <idoh@armosec.io>
2024-07-15 17:45:39 +03:00
idohu
ad0e50898a add architecture to README.md + fix first paragraph to bullets
Signed-off-by: idohu <idoh@armosec.io>
2024-07-15 17:43:09 +03:00
Matthias Bertschy
3cf45cffd8 Merge pull request #1716 from kubescape/fixfix
fix generated ValidatingAdmissionPolicyBinding
2024-07-15 16:35:27 +02:00
Matthias Bertschy
ac0d982531 fix generated ValidatingAdmissionPolicyBinding
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-07-15 16:05:27 +02:00
Matthias Bertschy
99e22efe7b Merge pull request #1450 from kubescape/update-docs
update docs
2024-07-15 13:03:33 +02:00
Oshrat Nir
aedeb8f9cb Update README.md
update time and relative timezone

Signed-off-by: Oshrat Nir <45561829+Oshratn@users.noreply.github.com>
2024-07-15 13:50:20 +03:00
Oshrat Nir
824e76200e Update README.md
Co-authored-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Signed-off-by: Oshrat Nir <45561829+Oshratn@users.noreply.github.com>
2024-07-15 13:44:52 +03:00
Oshrat Nir
8342f96a62 Merge branch 'master' into update-docs
Signed-off-by: Oshrat Nir <45561829+Oshratn@users.noreply.github.com>
2024-07-15 13:41:25 +03:00
Oshrat Nir
b824d52345 Update README.md
Updated with runtime security, bi-weekly meetings and messaging in general.

Signed-off-by: Oshrat Nir <45561829+Oshratn@users.noreply.github.com>
2024-07-15 13:33:16 +03:00
Matthias Bertschy
11b6567db4 Merge pull request #1713 from kubescape/fixfix
use proper params in pager call
2024-07-10 12:41:04 +02:00
Matthias Bertschy
c7d3105ca5 use proper params in pager call
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-07-10 11:58:06 +02:00
Matthias Bertschy
f1c15cd2b5 Merge pull request #1710 from ttimonen/ttimonen/handler
Simplify the concurrency in http handler for scan.
2024-07-08 22:27:34 +02:00
ttimonen
7507f58306 refactor(handler) Simplify the scan http handler concurrency.
In particular,
Replace scanResponseChan struct with a reply channel in req.
This removes one chokepoint with tracking a map of channel with a mutex wrapping by not sharing data across different requests and
 makes it easier to reason about the correctness of the behavior.

Other changes are mostly cosmetic to group your operations related to
the primitives you are operating on, reducing the average lifetime of
a local variable (matters mostly for humans; compilers are very good at this nowadays).

Also this is net benefical by reducing LOCs by 45.

Signed-off-by: ttimonen <toni.timonen@iki.fi>
2024-07-07 22:44:35 +00:00
ttimonen
48ad56a2ef Implement unit-test for scan handler.
It plays wtih channels and goroutines, so having it
behave correctly is not completely trivial and test
worthy.

Signed-off-by: ttimonen <toni.timonen@iki.fi>
2024-07-07 22:40:58 +00:00
Matthias Bertschy
2fdec20b28 Merge pull request #1709 from kubescape/listitems
use pager.EachListItem to filter parented resources
2024-07-04 07:14:10 +02:00
Matthias Bertschy
2d77ea7b62 use pager.EachListItem to filter parented resources
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-07-03 16:41:12 +02:00
Yonatan Amzallag
eacd559c34 Merge pull request #1708 from kubescape/debug-disk-space-checks
Changed large-runner type for binary-build job
2024-07-03 14:01:49 +03:00
yonatanamz
c56e5799d7 Changed large-runner type for binary-build job
Signed-off-by: yonatanamz <yonatan989@gmail.com>
2024-07-03 13:58:55 +03:00
Yonatan Amzallag
ae5744f54e Merge pull request #1707 from kubescape/debug-disk-space-checks
Use large runners for binary-build job
2024-07-03 12:54:55 +03:00
yonatanamz
c649cc66a5 Use large runners for binary-build job
Signed-off-by: yonatanamz <yonatan989@gmail.com>
2024-07-03 12:30:18 +03:00
Yonatan Amzallag
7db735ade6 Merge pull request #1706 from kubescape/debug-disk-space-checks
Add disk space checks to binary-build job
2024-07-03 11:10:03 +03:00
yonatanamz
456145e240 Add disk space checks to binary-build job
Signed-off-by: yonatanamz <yonatan989@gmail.com>
2024-07-03 11:03:53 +03:00
Matthias Bertschy
382a2f03c8 Merge pull request #1705 from kubescape/dependabot/go_modules/httphandler/github.com/gorilla/schema-1.4.1
Bump github.com/gorilla/schema from 1.2.0 to 1.4.1 in /httphandler
2024-07-02 10:00:41 +02:00
Matthias Bertschy
44ebf59d76 Merge pull request #1704 from kubescape/dependabot/go_modules/httphandler/github.com/hashicorp/go-getter-1.7.5
Bump github.com/hashicorp/go-getter from 1.7.4 to 1.7.5 in /httphandler
2024-07-02 09:56:58 +02:00
dependabot[bot]
0688e3620b Bump github.com/gorilla/schema from 1.2.0 to 1.4.1 in /httphandler
Bumps [github.com/gorilla/schema](https://github.com/gorilla/schema) from 1.2.0 to 1.4.1.
- [Release notes](https://github.com/gorilla/schema/releases)
- [Commits](https://github.com/gorilla/schema/compare/v1.2.0...v1.4.1)

---
updated-dependencies:
- dependency-name: github.com/gorilla/schema
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 07:38:23 +00:00
dependabot[bot]
ab534b0346 Bump github.com/hashicorp/go-getter from 1.7.4 to 1.7.5 in /httphandler
Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.4...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 07:34:16 +00:00
Matthias Bertschy
09420a41a7 Merge pull request #1703 from kubescape/dependabot/go_modules/github.com/hashicorp/go-getter-1.7.5
Bump github.com/hashicorp/go-getter from 1.7.4 to 1.7.5
2024-07-02 09:28:38 +02:00
dependabot[bot]
e93eb942a8 Bump github.com/hashicorp/go-getter from 1.7.4 to 1.7.5
Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.7.4 to 1.7.5.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.7.4...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 14:43:55 +00:00
Matthias Bertschy
12f87b2710 Merge pull request #1702 from kubescape/dependabot/go_modules/httphandler/github.com/hashicorp/go-retryablehttp-0.7.7
Bump github.com/hashicorp/go-retryablehttp from 0.7.5 to 0.7.7 in /httphandler
2024-06-25 10:19:43 +02:00
dependabot[bot]
d6dc8f219c Bump github.com/hashicorp/go-retryablehttp in /httphandler
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.5 to 0.7.7.
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.5...v0.7.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 07:46:08 +00:00
Matthias Bertschy
fb3376d305 Merge pull request #1701 from kubescape/dependabot/go_modules/github.com/hashicorp/go-retryablehttp-0.7.7
Bump github.com/hashicorp/go-retryablehttp from 0.7.5 to 0.7.7
2024-06-25 09:44:01 +02:00
dependabot[bot]
ef2ded1933 Bump github.com/hashicorp/go-retryablehttp from 0.7.5 to 0.7.7
Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.5 to 0.7.7.
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.5...v0.7.7)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 06:06:07 +00:00
Matthias Bertschy
e9f1d4085a Merge pull request #1700 from kubescape/dependabot/go_modules/httphandler/go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace-0.44.0
Bump go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace from 0.40.0 to 0.44.0 in /httphandler
2024-06-25 08:03:50 +02:00
dependabot[bot]
51a9707d24 Bump go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace
Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.40.0 to 0.44.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.40.0...zpages/v0.44.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 06:02:15 +00:00
Matthias Bertschy
a4058eac62 Merge pull request #1699 from kubescape/dependabot/go_modules/go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace-0.44.0
Bump go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace from 0.40.0 to 0.44.0
2024-06-25 07:59:15 +02:00
dependabot[bot]
f2b621134c Bump go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace
Bumps [go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.40.0 to 0.44.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.40.0...zpages/v0.44.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 05:49:43 +00:00
Matthias Bertschy
58ce50e751 Merge pull request #1440 from anubhav06/copa-grype
change reference from anubhav06 to project-copacetic
2024-06-25 07:45:50 +02:00
Anubhav Gupta
2bbedc99dd Merge branch 'master' of ssh://github.com/kubescape/kubescape into copa-grype 2024-06-22 08:59:18 +05:30
Matthias Bertschy
78794990d7 Merge pull request #1697 from kubescape/dependabot/go_modules/httphandler/github.com/Azure/azure-sdk-for-go/sdk/azidentity-1.6.0
Bump github.com/Azure/azure-sdk-for-go/sdk/azidentity from 1.5.1 to 1.6.0 in /httphandler
2024-06-17 14:01:50 +02:00
dependabot[bot]
a7127c0b27 Bump github.com/Azure/azure-sdk-for-go/sdk/azidentity in /httphandler
Bumps [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/internal/v1.5.1...sdk/azcore/v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 11:06:59 +00:00
Matthias Bertschy
01505406a6 Merge pull request #1696 from kubescape/dependabot/go_modules/github.com/Azure/azure-sdk-for-go/sdk/azidentity-1.6.0
Bump github.com/Azure/azure-sdk-for-go/sdk/azidentity from 1.5.1 to 1.6.0
2024-06-17 13:04:26 +02:00
dependabot[bot]
e1fe7cda50 Bump github.com/Azure/azure-sdk-for-go/sdk/azidentity
Bumps [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/internal/v1.5.1...sdk/azcore/v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 14:09:34 +00:00
Matthias Bertschy
f0bc2845cf Merge pull request #1695 from kubescape/rulename
update exceptions docs - ruleName not supported
2024-06-11 10:41:15 +02:00
YiscahLevySilas1
c2c521b715 ruleName not supported in exceptions
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2024-06-09 09:54:09 +03:00
Matthias Bertschy
2d5ea3e789 Merge pull request #1689 from kubescape/dependabot/go_modules/httphandler/github.com/aquasecurity/trivy-0.51.2
Bump github.com/aquasecurity/trivy from 0.44.1 to 0.51.2 in /httphandler
2024-06-05 07:20:45 +02:00
dependabot[bot]
137fe81701 Bump github.com/aquasecurity/trivy from 0.44.1 to 0.51.2 in /httphandler
Bumps [github.com/aquasecurity/trivy](https://github.com/aquasecurity/trivy) from 0.44.1 to 0.51.2.
- [Release notes](https://github.com/aquasecurity/trivy/releases)
- [Changelog](https://github.com/aquasecurity/trivy/blob/main/goreleaser.yml)
- [Commits](https://github.com/aquasecurity/trivy/compare/v0.44.1...v0.51.2)

---
updated-dependencies:
- dependency-name: github.com/aquasecurity/trivy
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-04 21:16:10 +00:00
Matthias Bertschy
f293606f81 Merge pull request #1682 from slashben/vap-helper-features
Adding two helper functions for VAP and CEL admission library
2024-06-04 23:12:05 +02:00
Matthias Bertschy
d6d2315ad0 fixes for vap helper
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-06-04 13:41:00 +02:00
Ben
65aa28dd38 renaming command
Signed-off-by: Ben <ben@armosec.io>
2024-06-03 23:33:01 +03:00
David Wertenteil
15e55e011c Merge pull request #1688 from kubescape/fix-panic
Fix scanning unsupported clouds
2024-05-26 16:28:30 +03:00
David Wertenteil
0ee98351c0 fix scanning unsupported clouds
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-05-26 15:45:19 +03:00
Matthias Bertschy
f52056a879 Merge pull request #1685 from kubescape/fixfix
fix yamlhandler deleting too many lines during fix
2024-05-23 10:19:02 +02:00
Matthias Bertschy
840162c865 fix yamlhandler deleting too many lines during fix
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-05-21 08:48:01 +02:00
Anubhav Gupta
160709eabf Merge branch 'master' of ssh://github.com/kubescape/kubescape into copa-grype 2024-05-17 13:37:25 +05:30
Ben Hirschberg
7f9f6d35f7 Merge pull request #1683 from kubescape/fix/mask-data
Mask all containers data
2024-05-09 20:42:28 +03:00
David Wertenteil
b2b37f6abc Mask all containers data
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-05-09 19:08:09 +03:00
Ben
0863d845e1 Adding two helper functions for VAP and CEL admission library
Signed-off-by: Ben <ben@armosec.io>
2024-05-09 14:32:04 +03:00
David Wertenteil
da6faa3df0 Merge pull request #1680 from kubescape/fix/repo-scanning
Fix scanning repo
2024-05-07 09:16:20 +03:00
David Wertenteil
3cbd2c458d fix scanning repo
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-05-06 16:22:38 +03:00
Matthias Bertschy
629451dd33 Merge pull request #1679 from kubescape/dependabot/go_modules/github.com/sigstore/cosign/v2-2.2.4
Bump github.com/sigstore/cosign/v2 from 2.2.3 to 2.2.4
2024-05-06 08:53:21 +02:00
dependabot[bot]
29a313e708 Bump github.com/sigstore/cosign/v2 from 2.2.3 to 2.2.4
Bumps [github.com/sigstore/cosign/v2](https://github.com/sigstore/cosign) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/sigstore/cosign/releases)
- [Changelog](https://github.com/sigstore/cosign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/cosign/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/sigstore/cosign/v2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 06:18:56 +00:00
Matthias Bertschy
38896ccd24 Merge pull request #1678 from kubescape/dependabot/go_modules/httphandler/github.com/sigstore/cosign/v2-2.2.4
Bump github.com/sigstore/cosign/v2 from 2.2.3 to 2.2.4 in /httphandler
2024-05-06 08:13:09 +02:00
dependabot[bot]
834623762d Bump github.com/sigstore/cosign/v2 from 2.2.3 to 2.2.4 in /httphandler
Bumps [github.com/sigstore/cosign/v2](https://github.com/sigstore/cosign) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/sigstore/cosign/releases)
- [Changelog](https://github.com/sigstore/cosign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sigstore/cosign/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/sigstore/cosign/v2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 05:40:44 +00:00
David Wertenteil
c937ed16f4 Merge pull request #1677 from kubescape/remove-tests
remove control_cluster tests
2024-05-01 10:21:42 +03:00
David Wertenteil
ea5f72af4e remove control_cluster tests
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-05-01 10:17:22 +03:00
David Wertenteil
beb5a4d43e Merge pull request #1676 from kubescape/fix/wf-permissions
fix
2024-04-30 16:29:32 +03:00
David Wertenteil
77e21d5e94 fix
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-04-30 16:28:19 +03:00
David Wertenteil
3fd7bf40cc Merge pull request #1675 from kubescape/fix/wf-permissions
fix
2024-04-30 16:25:48 +03:00
David Wertenteil
18e0a227e1 fix
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-04-30 16:23:30 +03:00
David Wertenteil
060c17b480 Merge pull request #1674 from kubescape/fix/wf-permissions
Permissions
2024-04-30 16:19:40 +03:00
David Wertenteil
e67a2e9d1c permissions
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-04-30 15:59:19 +03:00
David Wertenteil
dfa5f1037e Merge pull request #1673 from kubescape/operator-command
Fixed return status code
2024-04-30 15:55:27 +03:00
David Wertenteil
a15fc066e1 fixed return status code
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-04-30 15:26:38 +03:00
David Wertenteil
effc57dfda Merge pull request #1672 from kubescape/bumpsyft
fix go.mod for httphandler
2024-04-30 11:16:12 +03:00
Matthias Bertschy
4b5c2dfed4 fix go.mod for httphandler
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-30 09:57:29 +02:00
David Wertenteil
f39d4efd62 Merge pull request #1671 from kubescape/fix/wf-permissions
update permissions
2024-04-30 10:28:22 +03:00
David Wertenteil
97ce466fbd update permissions
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-04-30 10:27:23 +03:00
David Wertenteil
a94dc85e14 Merge pull request #1670 from kubescape/fix/wf-permissions
Adding attestations to the permissions
2024-04-30 10:23:48 +03:00
David Wertenteil
7811b0a4a6 adding attestations to the permissions
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-04-30 10:21:35 +03:00
David Wertenteil
f9cc9b5b28 Merge pull request #1665 from kubescape/checksum
re-enable checksum generation for releases
2024-04-30 08:44:19 +03:00
David Wertenteil
2f208c0866 Merge pull request #1668 from kubescape/bump
bump opa-utils
2024-04-30 08:43:19 +03:00
David Wertenteil
97e4ca749b Merge pull request #1669 from kubescape/bumpsyft
bump syft version
2024-04-30 08:24:37 +03:00
Matthias Bertschy
9521cf1974 bump syft version
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-29 14:00:18 +02:00
Matthias Bertschy
8ec56976c5 bump opa-utils
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-25 18:48:40 +02:00
Matthias Bertschy
5993f2db3a re-enable checksum generation for releases
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-22 13:19:27 +02:00
David Wertenteil
d0abfb4ae7 Merge pull request #1663 from fanqiaojun/master
Fix some comments
2024-04-14 10:56:32 +03:00
fanqiaojun
bd35d521f2 Fix some comments
Signed-off-by: fanqiaojun <fanqiaojun@yeah.net>
2024-04-13 15:42:01 +08:00
Matthias Bertschy
533c0392d4 Merge pull request #1662 from maxgio92/issue/1661
chore(core/pkg/resultshandling): add control id to pdf output
2024-04-11 10:56:37 +02:00
Massimiliano Giovagnoli
e0f2944fc8 chore(core/pkg/resultshandling): add control id to pdf output
Add a new column in the PDF output to reference each control that has
been executed as control ID.

Signed-off-by: Massimiliano Giovagnoli <me@maxgio.it>
2024-04-10 17:11:30 +02:00
Anubhav Gupta
4c9cacecfe fix lint
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2024-04-09 22:41:57 +05:30
Anubhav Gupta
6ee6a78a75 Merge branch 'master' of https://github.com/kubescape/kubescape into copa-grype 2024-04-09 21:37:46 +05:30
Anubhav Gupta
e754ecff4f fix grype name
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2024-04-09 21:33:16 +05:30
Matthias Bertschy
bda7a17f41 Merge pull request #1658 from needsure/master
chore: fix function names in comment
2024-04-09 11:47:07 +02:00
needsure
dee6ed96f8 chore: fix function names in comment
Signed-off-by: needsure <qinzhipeng@outlook.com>
2024-04-09 16:33:24 +08:00
Matthias Bertschy
0d1de027c9 Merge pull request #1657 from kubescape/defaultbranch
remove api calls from scan repo
2024-04-09 10:15:28 +02:00
Matthias Bertschy
22c85b5e3b Merge pull request #1656 from kubescape/scorecard
fix ossf/scorecard
2024-04-09 08:47:10 +02:00
Matthias Bertschy
d27284b6f6 remove api calls from scan repo
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-09 07:37:58 +02:00
Matthias Bertschy
4bde684d8a fix ossf/scorecard
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-04 21:32:10 +02:00
Ben Hirschberg
8cf735f84c Merge pull request #1654 from slashben/master
Updates in roadmap
2024-04-03 23:55:13 +03:00
Ben
e1db7f3704 updates in roadmap
Signed-off-by: Ben <ben@armosec.io>
2024-04-03 23:45:47 +03:00
Ben Hirschberg
fd64a068aa Merge pull request #1653 from slashben/master
Evidence on public use
2024-04-03 11:51:03 +03:00
Ben Hirschberg
1945d3dfaa Evidence on public use 2024-04-03 11:42:39 +03:00
Matthias Bertschy
42670c7a9f Merge pull request #1652 from kubescape/matthyx-patch-1
Update community meeting schedule
2024-04-02 15:18:48 +02:00
Matthias Bertschy
81a9ca4254 Update community meeting schedule
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-04-02 15:17:13 +02:00
David Wertenteil
00c0a205d6 Merge pull request #1651 from kubescape/yuleib-patch-1
Update b-binary-build-and-e2e-tests.yaml
2024-04-01 13:53:31 +03:00
Yuval Leibovich
374d8be96f Update b-binary-build-and-e2e-tests.yaml
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2024-04-01 13:34:13 +03:00
Matthias Bertschy
70daff7cec Merge pull request #1650 from kubescape/bump
bump deps for vulnerabilities
2024-03-28 12:06:56 +01:00
Matthias Bertschy
22fc14ae50 bump deps for vulnerabilities
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-28 10:05:38 +01:00
Matthias Bertschy
d9736d7d56 Merge pull request #1644 from kubescape/fix-panic-submitting-report
fix panic when submitting report
2024-03-27 10:54:28 +01:00
David Wertenteil
574763ccfc Merge pull request #1649 from kubescape/rego-v2
use regolibrary v2
2024-03-26 16:00:11 +02:00
YiscahLevySilas1
a8cc411945 update backend version
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2024-03-26 12:06:21 +02:00
Matthias Bertschy
0576548bbe Merge pull request #1648 from kubescape/scorecard
fix scorecard with actions/checkout v3.1.0
2024-03-26 08:41:07 +01:00
YiscahLevySilas1
0477f8cb03 use regolibrary v2
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2024-03-26 09:05:01 +02:00
Matthias Bertschy
9a2d58faa0 fix scorecard with actions/checkout v3.1.0
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-26 07:57:35 +01:00
Anubhav Gupta
b9fd60b395 fix
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2024-03-26 12:06:16 +05:30
Matthias Bertschy
d975f8e64a Merge pull request #1646 from kubescape/checkout
bump actions/checkout to v4
2024-03-25 10:27:51 +01:00
Matthias Bertschy
a2bd504e36 bump actions/checkout to v4
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-25 08:42:47 +01:00
Amir Malka
8a671b9658 fix panic when submitting report
Signed-off-by: Amir Malka <amirm@armosec.io>
2024-03-19 11:39:26 +02:00
David Wertenteil
b7a4f82968 Merge pull request #1642 from kubescape/fix-gitlab
fix permissions
2024-03-18 11:11:12 +02:00
Matthias Bertschy
0ee121a08f fix permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-18 10:09:42 +01:00
Matthias Bertschy
708bf4477a Fix gitlab (#1639)
* always use git token if we provide one

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* bump go-git-url for gitlab fix

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* fix action permissions for cosign signature

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

---------

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-18 11:02:39 +02:00
Amir Malka
56a9d9a7f3 fix panic when error is returned from SubmitReport (#1640)
Signed-off-by: Amir Malka <amirm@armosec.io>
2024-03-17 14:08:04 +02:00
David Wertenteil
337fb96e3f Merge pull request #1638 from kubescape/skip
remove scan_with_exception_to_backend from CI
2024-03-14 18:51:33 +02:00
Matthias Bertschy
c5fa53c00f remove scan_with_exception_to_backend from CI
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-14 17:50:38 +01:00
David Wertenteil
e2dc7d24f9 Merge pull request #1636 from kubescape/fix-gitlab
httphandler go mod tidy
2024-03-14 11:29:31 +02:00
Matthias Bertschy
d13dd9b3a7 httphandler go mod tidy
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-14 10:15:57 +01:00
David Wertenteil
aa0f13e348 Merge pull request #1635 from kubescape/fix-gitlab
bump go-git-url to fix private gitlab scans
2024-03-14 10:55:09 +02:00
Matthias Bertschy
725eab67f9 bump go-git-url to fix private gitlab scans
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-14 08:51:56 +01:00
Matthias Bertschy
6efa37a14d Merge pull request #1634 from kubescape/riscv
add riscv64 files to release step
2024-03-13 16:55:24 +01:00
Matthias Bertschy
f05ab61421 add riscv64 files to release step
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-13 15:13:05 +01:00
David Wertenteil
5217ad21ec Merge pull request #1633 from kubescape/fixk8sclient
get KubernetesClient only if k8s is not nil
2024-03-13 14:20:49 +02:00
Matthias Bertschy
55e570a2b2 get KubernetesClient only if k8s is not nil
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-13 10:45:32 +01:00
David Wertenteil
f64617c88c Merge pull request #1632 from kubescape/speedup
speedup golangci-lint-action by skipping caches
2024-03-13 10:13:24 +02:00
Matthias Bertschy
ad4996e553 speedup golangci-lint-action by skipping caches
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-13 09:04:23 +01:00
David Wertenteil
46febea6d3 Merge pull request #1631 from kubescape/fixrelease
set BuildNumber and Client from env
2024-03-12 17:42:36 +02:00
Matthias Bertschy
da022a1cf0 set BuildNumber and Client from env
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-12 16:11:58 +01:00
David Wertenteil
9d11f2d881 Merge pull request #1630 from kubescape/risc
add risc v build target
2024-03-11 11:44:14 +02:00
Matthias Bertschy
d0521b83ae add risc v build target
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-11 09:15:46 +01:00
David Wertenteil
d8d6ab96df Merge pull request #1629 from kubescape/fix/sarif-fix
Remove repeating fixes
2024-03-11 09:47:42 +02:00
David Wertenteil
abefe8c21a Merge pull request #1593 from kubescape/daily
update daily report
2024-03-11 09:26:28 +02:00
David Wertenteil
0e0e1ed6fb remove repeating fixes
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-03-11 09:22:03 +02:00
David Wertenteil
05ec28be48 Merge pull request #1628 from MMMMMMorty/fix_bug
Fix bug for no matches of yalib in one file mapping
2024-03-10 22:30:33 +02:00
mmmmmmorty
f5e110c212 Fix bug for no matches of yalib in one file mapping
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com>
2024-03-08 10:50:39 +02:00
Matthias Bertschy
2429d2b89d move versioncheck to kubescape/backend
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-06 14:44:37 +01:00
David Wertenteil
cf75cc3a7a Merge pull request #1626 from kubescape/gitlab
bump go-git-url for self-hosted gitlab
2024-03-06 14:29:48 +02:00
Matthias Bertschy
f1c34efa97 bump go-git-url for self-hosted gitlab
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-06 11:51:36 +01:00
Anubhav Gupta
f0c3a568f0 change reference from anubhav06 to project-copacetic
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2024-03-05 17:36:48 +01:00
David Wertenteil
7fd1396cff Fixed link (#1624)
* fixed link

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Adding unit tests to PR check

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-03-04 09:45:50 +02:00
David Wertenteil
522cc3a454 Merge pull request #1305 from hoorayman/fix/cmd-framework-redundant-code
fix(cmd/scan/framework.go): remove redundant code
2024-03-03 15:16:44 +02:00
David Wertenteil
cbdbd7433b Merge pull request #1623 from kubescape/go-sum
go sum
2024-03-01 15:22:39 +02:00
David Wertenteil
15b63401b7 go sum
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-03-01 15:21:22 +02:00
David Wertenteil
7f5d513e6b Merge pull request #1622 from kubescape/fix/releaser-action
Release artifacts
2024-03-01 15:13:35 +02:00
David Wertenteil
e87f3399c7 fixed release artifacts
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-03-01 15:09:25 +02:00
Alfredo Garcia
fad8f2b272 Add Vulnerability scanning report to the summaryDetails section (#1615)
* Add Vulnerability scanning report to the summaryDetails section

Signed-off-by: Alfredo Garcia <algarcia@vmware.com>

* Updating the opa-utils dependency version

Signed-off-by: Alfredo Garcia <algarcia@vmware.com>

---------

Signed-off-by: Alfredo Garcia <algarcia@vmware.com>
2024-03-01 14:59:23 +02:00
MMMMMMorty
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
David Wertenteil
0033dc881e Merge pull request #1620 from MMMMMMorty/fix_action_workflow
add github action actor check for pr-scanner
2024-02-29 16:29:58 +02:00
mmmmmmorty
9549e0dcde add github action actor check for pr-scanner
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com>
2024-02-29 15:23:27 +01:00
David Wertenteil
809146c070 Merge pull request #1619 from kubescape/fix/release
fix goreleaser
2024-02-29 13:11:20 +02:00
David Wertenteil
546b982891 fix goreleaser
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-02-29 13:04:26 +02:00
David Wertenteil
f8ac5af31b Merge pull request #1618 from kubescape/fix/exceptions
Fixing exceptions for regovector objects
2024-02-29 09:16:12 +02:00
David Wertenteil
20babdc071 Merge pull request #1614 from kubescape/revert-1612-adopters
Revert "add PR template for adopters"
2024-02-29 08:43:38 +02:00
David Wertenteil
533edc6d05 Fixing exceptions for regovector objects
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-02-29 08:42:32 +02:00
David Wertenteil
3362a38d09 Merge pull request #1616 from kubescape/bump-syft
image scan add schema v1 support
2024-02-28 13:16:04 +02:00
Matthias Bertschy
ac6c5ca570 image scan add schema v1 support
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-02-28 10:25:16 +01:00
David Wertenteil
ea7a8bef94 Fix/backlog (#1613)
* Many minor improvements

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Handle fw scan error

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Remove prometheus docs

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fix workload threshold

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed units

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-02-26 22:42:41 +02:00
David Wertenteil
e74ceec858 Revert "add PR template for adopters" 2024-02-26 17:45:19 +02:00
David Wertenteil
e6150d405e Merge pull request #1612 from kubescape/adopters
add PR template for adopters
2024-02-26 17:44:55 +02:00
Matthias Bertschy
86331c6abd add PR template for adopters
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-02-26 13:45:41 +01:00
Matthias Bertschy
3f866683a4 Merge pull request #1611 from kubescape/dependabot/go_modules/httphandler/helm.sh/helm/v3-3.14.2
Bump helm.sh/helm/v3 from 3.12.1 to 3.14.2 in /httphandler
2024-02-25 22:40:38 +01:00
dependabot[bot]
3affee539f Bump helm.sh/helm/v3 from 3.12.1 to 3.14.2 in /httphandler
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.12.1 to 3.14.2.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](https://github.com/helm/helm/compare/v3.12.1...v3.14.2)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-25 21:35:19 +00:00
Matthias Bertschy
513bfa91be Merge pull request #1610 from kubescape/dependabot/go_modules/helm.sh/helm/v3-3.14.2
Bump helm.sh/helm/v3 from 3.12.1 to 3.14.2
2024-02-25 22:32:36 +01:00
dependabot[bot]
e644b6cc74 Bump helm.sh/helm/v3 from 3.12.1 to 3.14.2
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.12.1 to 3.14.2.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](https://github.com/helm/helm/compare/v3.12.1...v3.14.2)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-25 21:29:21 +00:00
David Wertenteil
10f0a04a6e Merge pull request #1609 from kubescape/fix/eks-region-parser
Bump k8s-interface version
2024-02-25 10:20:40 +02:00
David Wertenteil
6c5c1265d5 Bump k8s-interface version
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-02-22 18:23:48 +02:00
David Wertenteil
18df5dc5ed Merge pull request #1608 from kubescape/fix/unknown-fw
Handle unknown fw
2024-02-22 17:52:23 +02:00
David Wertenteil
05903e34ff Handle unknown fw
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-02-22 17:05:38 +02:00
David Wertenteil
9b05fb60e4 Merge pull request #1607 from kubescape/fix/fw-list
Remove "%" from the print
2024-02-22 15:36:24 +02:00
David Wertenteil
d01a7977ae Remove "%" from the print
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-02-22 14:26:51 +02:00
David Wertenteil
121e4ccad4 Merge pull request #1590 from kubescape/nolibgit
remove libgit files and dependencies
2024-02-21 15:29:04 +02:00
hoorayman
f1eaf09570 fix(cmd/scan/framework.go): remove redundant code
Signed-off-by: hoorayman <813458665@qq.com>
2024-02-20 10:40:17 +08:00
Matthias Bertschy
179befbcd5 Merge pull request #1599 from kubescape/dependabot/go_modules/github.com/moby/buildkit-0.12.5
Bump github.com/moby/buildkit from 0.12.1 to 0.12.5
2024-02-07 13:34:50 +01:00
dependabot[bot]
036b7e25fa Bump github.com/moby/buildkit from 0.12.1 to 0.12.5
Bumps [github.com/moby/buildkit](https://github.com/moby/buildkit) from 0.12.1 to 0.12.5.
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.12.1...v0.12.5)

---
updated-dependencies:
- dependency-name: github.com/moby/buildkit
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 11:15:26 +00:00
Matthias Bertschy
cf8c00fb54 Merge pull request #1598 from kubescape/dependabot/go_modules/httphandler/github.com/moby/buildkit-0.12.5
Bump github.com/moby/buildkit from 0.12.1 to 0.12.5 in /httphandler
2024-02-07 12:12:54 +01:00
dependabot[bot]
5fd7529c90 Bump github.com/moby/buildkit from 0.12.1 to 0.12.5 in /httphandler
Bumps [github.com/moby/buildkit](https://github.com/moby/buildkit) from 0.12.1 to 0.12.5.
- [Release notes](https://github.com/moby/buildkit/releases)
- [Commits](https://github.com/moby/buildkit/compare/v0.12.1...v0.12.5)

---
updated-dependencies:
- dependency-name: github.com/moby/buildkit
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 09:46:39 +00:00
Matthias Bertschy
be5efbb3ef correct kubescape path in run-tests
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-01-20 22:00:49 +01: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
Matthias Bertschy
71fac79876 Merge pull request #1589 from kubescape/dependabot/go_modules/github.com/cloudflare/circl-1.3.7
Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7
2024-01-18 07:31:34 +01:00
dependabot[bot]
f430120ff4 Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.3...v1.3.7)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-17 16:52:37 +00:00
Matthias Bertschy
8844f8144b Merge pull request #1586 from kubescape/fix-cosign
fetch Rekor before cosign validation
2024-01-16 12:39:28 +01:00
YiscahLevySilas1
1b59b6a35f fix backslashes
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2024-01-16 11:59:28 +02:00
Matthias Bertschy
6a6e4181bd fetch Rekor before cosign validation
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-01-15 14:33:39 +01:00
Matthias Bertschy
5e41d7db1e Merge pull request #1584 from kubescape/dependabot/go_modules/httphandler/github.com/cloudflare/circl-1.3.7
Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 in /httphandler
2024-01-15 11:48:02 +01:00
dependabot[bot]
5e9fbf05f1 Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 in /httphandler
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.3...v1.3.7)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 07:28:16 +00:00
David Wertenteil
b4f58f3a6d Merge pull request #1581 from matoruru/patch-1
Fix markdown syntax error
2024-01-11 10:35:23 +02:00
David Wertenteil
2ec3e47f0a Merge pull request #1455 from matthyx/master
use goreleaser for builds
2024-01-11 10:35:11 +02:00
matoruru
b6030c0bc5 Fix markdown syntax
Signed-off-by: matoruru <40382980+matoruru@users.noreply.github.com>
2024-01-10 15:36:56 +09:00
Amir Malka
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
Matthias Bertschy
bdefcd2442 use goreleaser for builds
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-01-09 08:10:05 +01:00
David Wertenteil
4e4a642673 Fixed filepath test (#1577)
* remove unstable tests

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* skip tests on windows

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* temp: skip tests

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-01-08 10:29:31 +02:00
David Wertenteil
3634499e11 Fixed filepath test (#1576)
* remove unstable tests

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* skip tests on windows

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-01-07 23:00:16 +02:00
David Wertenteil
9f5d4f97df Merge pull request #1575 from kubescape/fixed-filepath-test
filepath test
2024-01-07 20:37:38 +02:00
David Wertenteil
a0e6ebe0e0 filepath test
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-01-07 18:00:45 +02:00
David Wertenteil
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
David Wertenteil
d15a837139 Hotfix gitlab url (#1572)
* update pkgs

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update k8sinterface

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* bump k8s-interface pkg

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update k8sinterface

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* go mod

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2024-01-04 16:29:40 +02:00
David Wertenteil
d4cb97905e Merge pull request #1566 from kubescape/fix-naming-convention
Bump k8s-interface pkg
2024-01-04 16:05:38 +02:00
Matthias Bertschy
4208ed1ca6 Merge pull request #1456 from kubescape/fix-docker-build
Fix Docker Build for Kubescape-CLI
2024-01-03 15:52:12 +01:00
Matthias Bertschy
4adb1da4d2 Merge pull request #1556 from VaibhavMalik4187/locationresolver-tests
Added missing tests for locationresolver
2024-01-03 15:49:40 +01:00
Matthias Bertschy
3ba1e9c187 Merge pull request #1570 from kubescape/dependabot/go_modules/github.com/go-git/go-git/v5-5.11.0
Bump github.com/go-git/go-git/v5 from 5.8.1 to 5.11.0
2024-01-03 14:35:35 +01:00
dependabot[bot]
81eec99b51 Bump github.com/go-git/go-git/v5 from 5.8.1 to 5.11.0
Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.8.1 to 5.11.0.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](https://github.com/go-git/go-git/compare/v5.8.1...v5.11.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-03 13:00:47 +00:00
Matthias Bertschy
3ba3af8244 Merge pull request #1569 from kubescape/dependabot/go_modules/httphandler/github.com/go-git/go-git/v5-5.11.0
Bump github.com/go-git/go-git/v5 from 5.8.1 to 5.11.0 in /httphandler
2024-01-03 13:58:31 +01:00
dependabot[bot]
8ca6f71d57 Bump github.com/go-git/go-git/v5 from 5.8.1 to 5.11.0 in /httphandler
Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.8.1 to 5.11.0.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](https://github.com/go-git/go-git/compare/v5.8.1...v5.11.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 11:31:26 +00:00
David Wertenteil
10278a9088 bump k8s-interface pkg
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-12-24 15:50:17 +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
Yuval Leibovich
06d9c9d31c Merge pull request #1562 from kubescape/remove-control-0086
Remove control 0086
2023-12-14 18:50:37 +02:00
David Wertenteil
f309d54b08 Merge pull request #1558 from kubescape/wlid
add wlid annotation to workloadconfigurationscans and summaries
2023-12-14 13:35:48 +02:00
Yuval Leibovich
0d2a667299 Update html-format.html
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-12-13 15:45:58 +02:00
Yuval Leibovich
1dd8022d6a removing control 0086
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-12-13 15:42:42 +02:00
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
Matthias Bertschy
e27237047e Merge pull request #1561 from kubescape/bump
patch GHSA-3f2q-6294-fmq5 by switching to chainguard's fork
2023-12-11 07:29:00 +01:00
Matthias Bertschy
1b260f60cc patch GHSA-3f2q-6294-fmq5 by switching to chainguard's fork
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-12-11 07:19:05 +01:00
David Wertenteil
882a8404d3 Merge pull request #1557 from kubescape/feature/slack-badge
Adding slack badge to README.md
2023-12-05 16:49:58 +02:00
Amit Schendel
b797413ef0 Adding slack badge to README.md
Signed-off-by: Amit Schendel <amitschendel@gmail.com>
2023-12-04 21:36:00 +02:00
David Wertenteil
298e30e857 Merge pull request #1489 from kubescape/oshrat_branch
update readme
2023-12-03 16:30:42 +02:00
David Wertenteil
6ba727b721 Merge pull request #1555 from kubescape/adding-start-badge
Adding stars badge
2023-12-03 16:30:12 +02:00
Matthias Bertschy
362557a964 Merge pull request #1554 from VaibhavMalik4187/scan-crash-fix
Fixed crash when running the scan command
2023-12-01 07:12:09 +01:00
Amit Schendel
c119911914 Adding starts badge
Signed-off-by: Amit Schendel <amitschendel@gmail.com>
2023-11-30 13:54:21 +02:00
VaibhavMalik4187
de2e86dc6e Fixed crash when running the scan command
Updated the `getSortPackageScores` function to fix the crash in the scan
command.

Fixes: https://github.com/kubescape/kubescape/issues/1553

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-30 15:12:33 +05:30
Matthias Bertschy
a2aa52f4cb Merge pull request #1551 from MMMMMMorty/fix_action_workflow
Add github action actor check for binary-build
2023-11-28 15:46:50 +01:00
mmmmmmorty
a382a2c5a3 add github action actor check for binary-build
Signed-off-by: mmmmmmorty <mmmmmmorty@outlook.com>
2023-11-28 14:35:36 +01:00
Matthias Bertschy
dd5a18c8fa Merge pull request #1544 from mohaidoss/Improvement/ks-cloud-logs
Enhancement of Logging Mechanisms for KS Cloud Usage
2023-11-27 16:48:10 +01:00
Yuval Leibovich
e4e795c6dc Merge pull request #1548 from kubescape/remove-armoBuiltin
Removal of "armoBuiltin" attribute from JSON files
2023-11-27 16:17:35 +02:00
Matthias Bertschy
2c65d92d69 Merge pull request #1549 from VaibhavMalik4187/junit-tests
Addition of new tests for junit printer, version check and PDF printer
2023-11-27 15:02:17 +01: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
Matthias Bertschy
289e055014 Merge pull request #1547 from kubescape/add-scan-source
add scan source
2023-11-27 12:38:11 +01:00
Matthias Bertschy
81ba550043 Merge pull request #1537 from VaibhavMalik4187/printer-tests-continued
Addition of Tests for the PrettyPrinter Package
2023-11-27 11:11:15 +01:00
Matthias Bertschy
8e5d8e5c96 Merge pull request #1539 from VaibhavMalik4187/prettyprinter/utils
Performance Enhancements and Test Additions in prettyprinter/utils.go
2023-11-27 11:08:16 +01:00
Matthias Bertschy
5789f1f0fa Merge pull request #1542 from VaibhavMalik4187/imageprinter-tests
Added new tests in the imagewriter package
2023-11-27 11:07:30 +01:00
Matthias Bertschy
9a523f4a01 Merge pull request #1545 from VaibhavMalik4187/configurationprinter-tests
Enhancements and Tests for Configuration Printer
2023-11-27 11:06:38 +01:00
Matthias Bertschy
fb3357fba4 Merge pull request #1546 from kubescape/set-default-format
Set default format
2023-11-27 11:02:49 +01:00
Yuval Leibovich
69362ae415 Update MITRE.json
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-27 12:01:14 +02:00
Daniel Grunberger
de799d7b75 fix version
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 11:58:04 +02:00
Yuval Leibovich
bb17e1de78 Update NSA.json
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-27 11:57:31 +02:00
Daniel Grunberger
23013d6fe6 bring back version
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 11:57:03 +02:00
Daniel Grunberger
27d2fe8f27 fix version
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 11:56:03 +02:00
Yuval Leibovich
504891f519 Update C-0001.json
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-27 11:51:09 +02:00
Yuval Leibovich
d1606c5e39 Update processorhandler_test.go
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-27 11:46:50 +02:00
Daniel Grunberger
952beddcc3 add scan source
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 11:24:25 +02:00
Daniel Grunberger
9630adc74b remove toolchain
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 09:53:01 +02:00
Daniel Grunberger
27c171d09c go mod for http
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 09:45:29 +02:00
Daniel Grunberger
bd79fe4d8d update go version
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 09:37:13 +02:00
Daniel Grunberger
08f3756608 fix test
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 09:25:07 +02:00
Daniel Grunberger
7cda7346b7 set default
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-11-27 08:56:33 +02:00
VaibhavMalik4187
8cd0bddf6f Enhancements and tests for configurationprinter
Wrote new tests for `categorytable` and `frameworkscan`

Refactored the `shortFormatRow` function for:
- Imporved readability
- Consistency
- Improve code modularity
- Encapsulation: The formatted string construction is encapsulated
  within the function, maintaining code modularity and separation of
  concerns.

Added the `MockISeverityCounters` mock struct to test the
`renderSeverityCountersSummary` function.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-27 11:35:24 +05:30
VaibhavMalik4187
8fa7fc922d Added tests for the prettyprinter package
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-27 03:46:45 +05:30
VaibhavMalik4187
6a2e48ac74 Performance enhancements in utils.go
Improvments:
1. filterCVEsBySeverities
  - This approach is faster than iterating over the severities slice
    for each CVE. The map is created in advance, eliminating the
    need for repeated string comparisons.

2. getSortPackageScores
  - Avoids unnecessary map lookups by creating a slice of
    imageprinter.PackageScore pointers.

3. getSortedCVEsBySeverity
  - Avoiding Map Lookups
  - Efficient Sorting
  - Optimized Output

Added tests for tableprinter/utils

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-27 03:15:20 +05:30
Mehdi Moussaif
b68cfbed67 Added logs for when KS CLOUD is used
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-26 22:26:58 +01:00
VaibhavMalik4187
0bfbb87285 Added tests in imageprinter package
Added tests for the following functions:
- `generateTable`
- `NewTableWriter`
- `PrintImageScanningTable`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-27 02:33:15 +05:30
Matthias Bertschy
491ed09f6c Merge pull request #1536 from VaibhavMalik4187/printer/pdf-tests
Enhancement and Test Suite for Printer Functions
2023-11-26 22:02:03 +01:00
Matthias Bertschy
658855aaee Merge pull request #1540 from mohaidoss/enhancement/yamlfile_validation
Enhancement of YAML File Validation and Corresponding Test Cases
2023-11-26 21:55:53 +01:00
Matthias Bertschy
5ed8e180b3 Merge pull request #1521 from Umair0343/fix/add-missing-test-case
Added new test cases for different shell completions in the completion package to enhance test coverage.
2023-11-26 21:52:53 +01:00
VaibhavMalik4187
e4477eaac4 Fixed invalid input bug, added tests for printers
Added tests in the jsonprinter.go, junit.go pdf.go prometheus.go files
and updated the `Score` functions to handle invalid scores.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-27 01:25:46 +05:30
Matthias Bertschy
64351f93be Merge pull request #1538 from mohaidoss/tests/core-pkg-resourceprioritization
Refactoring and Adding Tests for Resource Prioritization
2023-11-26 20:32:50 +01:00
Mehdi Moussaif
70a010976e Removed unused functions
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-26 19:06:10 +01:00
Mehdi Moussaif
d653530ba2 Add YAML validation
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-26 16:34:37 +01:00
Mehdi Moussaif
5242e8c4b0 Add test cases for loading host sensor from file
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-26 16:34:26 +01:00
Mehdi Moussaif
efd2f7e77f Adding tests for core/pkg/resourcesprioritization
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-26 14:56:12 +01:00
Mehdi Moussaif
16c632950d SupportedKinds refactored
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-26 14:43:12 +01:00
Umair
070d8544cd Update completion_test.go
removed the package import "strings" as it was not being used in the code

Signed-off-by: Umair <58398786+Umair0343@users.noreply.github.com>
2023-11-26 16:26:21 +05:00
Yuval Leibovich
b562c1d730 Merge pull request #1499 from kubescape/armoBuildin-removal
Update loadmocks.go
2023-11-26 13:06:35 +02:00
Matthias Bertschy
fdeadda704 Merge pull request #1534 from VaibhavMalik4187/printer/prometheusutils-tests
Added Test Suite for Prometheus Utilities
2023-11-26 11:58:47 +01:00
Matthias Bertschy
5ef720bfee Merge pull request #1533 from Umair0343/patch-4
Update framework_test.go (Add Test Case for Non-Existent Framework in…
2023-11-26 11:56:25 +01:00
Matthias Bertschy
0bc2b33e99 Merge pull request #1531 from Umair0343/patch-3
Update control_test.go (Add Test Case for Non-Existent Control in Get…
2023-11-26 11:55:11 +01:00
Matthias Bertschy
b9bcb6bbbf Merge pull request #1529 from Umair0343/patch-2
Update patch_test.go (Add Test Case for Non-Existent Image in GetPatchCmd)
2023-11-26 11:54:28 +01:00
Matthias Bertschy
620f9b2717 Merge pull request #1528 from sulemaanhamza/test-suite-strutils
Enhancement and Testing of String Utilities
2023-11-26 11:51:42 +01:00
Matthias Bertschy
2ff1512ed0 Merge pull request #1527 from Umair0343/patch-1
Update set_test.go
2023-11-26 11:47:25 +01:00
Matthias Bertschy
ca57f66b8b Merge pull request #1525 from VaibhavMalik4187/printer/resourcetable-tests
Enhancement and Test Suite for ResourceTable
2023-11-26 11:45:46 +01:00
VaibhavMalik4187
770f660db5 Enhancements and Test Suite for resourcetable
Wrote new tests for the functions in the resourcetable.go file.

Enhancements:
1. `generateResourceHeader`:
  - Dynamic Header Length
  - Efficient Header Creation
  - Clearer Code Structure

2. `appendFailedPathsIfNotInPaths`:
  - Create a set to efficiently check if a failed path already exists in
    the paths slice
  - Append failed paths if they are not already present

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-26 15:50:40 +05:30
VaibhavMalik4187
f54c2ee822 Added Test Suite for prometheusutils
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-26 15:00:15 +05:30
Umair
5172ce30d1 Update framework_test.go (Add Test Case for Non-Existent Framework in GetFrameworkCmd)
Description:

This pull request introduces a new test case TestGetFrameworkCmdWithNonExistentFramework in the framework_test.go file. The purpose of this test case is to verify the behavior of the getFrameworkCmd function when it's run with a non-existent framework argument.

In this test case, we:

Create a mock Kubescape interface and a ScanInfo object
Call the getFrameworkCmd function with the mock interface and ScanInfo object
Run the command with a non-existent framework argument
Check that there is an error and the error message is "bad argument: account ID must be a valid UUID"

This test case enhances the test coverage of the getFrameworkCmd function and ensures that it correctly handles non-existent framework arguments.

Signed-off-by: Umair <58398786+Umair0343@users.noreply.github.com>
2023-11-26 13:29:20 +05:00
Umair
4e24ad87dd Update control_test.go (Add Test Case for Non-Existent Control in GetControlCmd)
Description:

This pull request introduces a new test case TestGetControlCmdWithNonExistentControl in the control_test.go file. The purpose of this test case is to verify the behavior of the getControlCmd function when it's run with a non-existent control argument.

In this test case, we:

Create a mock Kubescape interface and a ScanInfo object
Call the getControlCmd function with the mock interface and ScanInfo object
Run the command with a non-existent control argument
Check that there is an error and the error message is "bad argument: account ID must be a valid UUID"

This test case enhances the test coverage of the getControlCmd function and ensures that it correctly handles non-existent control arguments.

Signed-off-by: Umair <58398786+Umair0343@users.noreply.github.com>
2023-11-26 13:20:00 +05:00
Umair
c49f9c88e2 Update patch_test.go
Title: Add Test Case for Non-Existent Image in GetPatchCmd

Description:

This pull request introduces a new test case TestGetPatchCmdWithNonExistentImage in the patch_test.go file. The purpose of this test case is to verify the behavior of the GetPatchCmd function when it's run with a non-existent image argument.

In this test case, we:

Create a mock Kubescape interface
Call the GetPatchCmd function with the mock interface
Run the command with a non-existent image argument
Check that there is an error and the error message is "image tag is required"

This test case enhances the test coverage of the GetPatchCmd function and ensures that it correctly handles non-existent image arguments.

Signed-off-by: Umair <58398786+Umair0343@users.noreply.github.com>
2023-11-26 13:06:18 +05:00
Yuval Leibovich
4bf3783677 Update a-pr-scanner.yaml
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-26 10:03:10 +02:00
Yuval Leibovich
139a89770f Update a-pr-scanner.yaml
Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-26 09:47:59 +02: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
Umair
2fb4efa531 Update set_test.go
Pull Request Description:

Changes Made
Added a new test case TestParseSetArgs_InvalidKey in the config package to cover scenarios where an invalid key is provided in the set command arguments.

Test Case Details
Function Tested: TestParseSetArgs_InvalidKey
Test Objective: Ensures that the parseSetArgs function correctly handles the scenario where an invalid key is provided, returning an appropriate error message.
Test Input: Command arguments with an invalid key, e.g., invalidKey=value1.
Expected Output: The function should return an error message indicating that the provided key is unknown, along with the list of supported keys.

Motivation
This new test case enhances the test coverage for the parseSetArgs function, ensuring robust handling of invalid keys during the configuration setting process. By validating that the function produces the expected error message for such cases, we contribute to the overall reliability of the codebase. This addition further strengthens the testing suite for the config package, promoting code quality and correctness.

Signed-off-by: Umair <58398786+Umair0343@users.noreply.github.com>
2023-11-26 11:04:01 +05:00
Umair
1d2993e83e Update completion_test.go
Pull Request Description:

Changes Made
Added new test cases for different shell completions in the completion package to enhance test coverage.

New Test Cases
TestGetCompletionCmd_RunBashCompletionNotExpectedOutputs: Tests that the output for Bash completion does not match the specified unexpected outputs.
TestGetCompletionCmd_RunZshCompletionNotExpectedOutputs: Tests that the output for Zsh completion does not match the specified unexpected outputs.
TestGetCompletionCmd_RunFishCompletionNotExpectedOutputs: Tests that the output for Fish completion does not match the specified unexpected outputs.
TestGetCompletionCmd_RunPowerShellCompletionNotExpectedOutputs: Tests that the output for PowerShell completion does not match the specified unexpected outputs.
Motivation
These new test cases aim to further validate the behavior of the GetCompletionCmd function for various shell completions. By ensuring that the actual output does not match the unexpected outputs, we strengthen the reliability of the completion script generation for different shells.

These test cases enhance the robustness of the codebase and provide additional validation for the autocompletion script generation functionality.

Signed-off-by: Umair <58398786+Umair0343@users.noreply.github.com>
2023-11-26 10:43:59 +05:00
Matthias Bertschy
68f5ae7ed2 Merge pull request #1516 from mohaidoss/tests/core-pkg-fixhandler
Bug Fix and Test Addition for sanitizeYaml and revertSanitizeYaml Functions
2023-11-25 22:31:39 +01:00
Mehdi Moussaif
803b8dc5a4 Adding tests core/pkg/fixhandler
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Adding tests core/pkg/fixhandler

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-25 22:21:45 +01:00
Matthias Bertschy
b0913b2a4f Merge pull request #1515 from mohaidoss/bugfix/pkg-imagescan
Bugfix and Tests for Image Scan Package
2023-11-25 21:50:30 +01:00
Matthias Bertschy
8f9824a426 Merge pull request #1526 from kubescape/gomod
fix go mod
2023-11-25 21:47:11 +01:00
Matthias Bertschy
28baac78fb fix go mod
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-11-25 21:41:35 +01:00
Mehdi Moussaif
210b5dac33 Fix: nil memory pointer when scanResults.MetadataProvider is nil
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-25 21:29:15 +01:00
Matthias Bertschy
2d31472fa1 Merge pull request #1520 from mohaidoss/feature/natural_sort_policy_list
Implement Natural Sorting for Policy Listing
2023-11-25 21:20:32 +01:00
Matthias Bertschy
a3b4d60dfb Merge pull request #1517 from VaibhavMalik4187/printer-tests
Enhancement of the printer package with additional tests and refactoring
2023-11-25 21:18:36 +01:00
Matthias Bertschy
50bd74a173 Merge pull request #1514 from VaibhavMalik4187/pkg-tests
Enhancement: Added Unit Tests for Multiple Packages
2023-11-25 21:01:32 +01:00
Matthias Bertschy
9ea4b0dd93 Merge pull request #1513 from VaibhavMalik4187/cmd-tests-continued
Add Test Suite for cmd Packages and Fix Potential Crash in Image Subcommand
2023-11-25 20:56:43 +01:00
Mehdi Moussaif
ba3e416eb8 Natural sort when listing policies
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-25 20:41:48 +01:00
VaibhavMalik4187
0af0f2a229 Added tests for the printer package
Wrote new tests for the printer package and refactored the CalculateMove
function to prevent potential out of bounds crash

Refactored the `addFix` function for better readability, understanding
and chaining method calls.

Used formatted string for logging.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-26 00:28:50 +05:30
Umair0343
bca14ea369 Add a test case to verify that the command produces the expected autocompletion scripts for each shell type.
Signed-off-by: Umair0343 <umairshahidpti@gmail.com>
2023-11-25 22:46:30 +05:00
VaibhavMalik4187
6f1919bbe2 Added Test Suite for several packages
This PR focuses on adding unit tests for multiple packages in the
project. The main changes include:

- Addition of new tests for the 'printer' package in the
  'core/pkg/resultshandling/printer' directory.
- New tests for the 'results' package in the
  'core/pkg/resultshandling' directory.
- Addition of tests for the 'config' package in the
  'httphandler/config' directory.
- New tests for the 'testutils' package in the 'internal/testutils'
  directory.
- Addition of tests for the 'imagescan' package in the
  'pkg/imagescan' directory.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-25 22:34:48 +05:30
Mehdi Moussaif
11401c755a Minor bug in sanitizeYaml and revertSanitizeYaml functions
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-25 15:57:33 +01:00
VaibhavMalik4187
69bbf7f72e Added Test Suite for the cmd packages
Wrote new tests for the following packages
- operator
- patch
- scan

Also fixed potential crash in the RunE function of the image subcommand
in the scan package.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-25 16:57:14 +05:30
Matthias Bertschy
524b6f2b1d Merge pull request #1512 from VaibhavMalik4187/cmd-tests
Enhancement: Added Test Suite for cmd package and Fixed Potential Crashes
2023-11-25 10:49:59 +01:00
Matthias Bertschy
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
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
Matthias Bertschy
3d606245f2 Merge pull request #1502 from VaibhavMalik4187/core-core-tests
Adding Test Suite for the core/core package
2023-11-25 10:41:01 +01:00
VaibhavMalik4187
85da52ebbd Added Test Suite and fixed bugs for cmd package
Wrote ne tsts for the following packages:
- completion
- config
- download
- fix
- list

Also addressed a potential crash in the compleition, download, and list
subcommands when no arguement was provided to the Args, RunE or Run
functions.

Updated `DownloadSupportCommands`, 'ListSupportActions' function to return sorted slice of
strings.

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-25 12:26:26 +05:30
VaibhavMalik4187
9e7eb6243a Added Test Suite for the core/core package
Wrote new tests for the following files:
- download.go
- fix.go
- list.go
- scan.go

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-25 08:41:37 +05:30
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
Matthias Bertschy
029b4c2677 Merge pull request #1504 from cbrom/core_pkg_containerscan_tests
Enhancement of Test Coverage and Code Improvements in Container Scan Package
2023-11-24 21:28:32 +01:00
Matthias Bertschy
84d4ff7cfe Merge pull request #1508 from VaibhavMalik4187/cmd-tests
Enhancement of Test Suite for cmd Packages
2023-11-24 21:18:42 +01:00
Matthias Bertschy
a76e02cb8a Merge pull request #1510 from sulemaanhamza/pkg-policyhandler-cache
Enhancement of TimedCache with Bug Fixes and Test Suite
2023-11-24 21:13:21 +01:00
VaibhavMalik4187
f351b3b333 Added Test Suite for the cmd packages
Wrote new tests for the following packages in the cmd package:
- completion
- config
  * In addition to tests, updated the code for the `stringKeysToSlice`
    to return the final string slice in sorted order of keys.

Added new MockIKubescape struct in the core/mocks package

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-25 01:17:58 +05:30
Mehdi Moussaif
dfd13aea6f Add tests for krewutils
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-24 18:48:04 +01:00
sulemaanhamza
660a9801a4 TimedCache - Potential bug fixes, removing possible memory leaks and test suite
1. Use time.Time for expiration to simplify expiration checks.
2. Added a stopChan and a Stop method to properly stop the invalidateTask goroutine instead of directly changing values
3. Used Ticker in invalidateTask for periodic expiration checks
4. Leak Prevention: The invalidateTask() loop checks the TTL value before continuing. If the TTL is zero, the goroutine exits gracefully, preventing a memory leak.

Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2023-11-24 22:39:00 +05: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
Matthias Bertschy
c02c8bf7e2 Merge pull request #1507 from mohaidoss/bugfix/kubescape-update-cmd
Enhancement of 'update' command and addition of tests for version check
2023-11-24 17:51:42 +01:00
Matthias Bertschy
aa45a874b9 Merge pull request #1505 from mohaidoss/tests/cmd-shared
Adding Unit Tests for cmd/shared Package
2023-11-24 17:50:45 +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
9c38c1a090 Add tests for cmd/shared
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-24 15:49:13 +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
cbrom
f3670ca629 coverage test for ScanResultReport AsFNVHash function
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
3ce838e344 added tests for ElasticContainerScanSummaryResult Validate function
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
e8228c149a added ElasticContainerScanSummaryResult Validate function doc string
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
ef3bda9972 removed ToFlatVulnerabilities function as there is no reference anywhere
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
66df4412b0 updated go.sum
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
db1c4afcd6 assert instead of if else check on tests
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
5ea09516ef tests added for ScanResultReport.Validate function
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
a0911d8752 added doc string for exported functions in datastructuresmethods.go
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
47d81ce721 added a basic test for GetPackagesNames
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
6fe6dbb333 added doc comment for exported function GetPackageNames
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
53f45e599a GetFilesByPackage function removed along with tests as it is not used anywhere except in tests
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
cbrom
6b4ef219c9 added more testcases for CalculateFixed function
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-24 15:07:11 +03:00
Matthias Bertschy
d496485f75 Merge pull request #1501 from mohaidoss/tests/core-initutils
Adding tests for core/core/initutils and fixing potential bug
2023-11-24 12:13:18 +01:00
Mehdi Moussaif
d6bb70ba4a Use tenantConfig instead of KSCloudAPIConnector, Add tests for core/core/initutils
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Add tests for core/core/initutils

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Potential bug, Use tenantConfig instead of KSCloudAPIConnector

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-24 11:35:21 +01:00
Matthias Bertschy
1f0cbad800 Merge pull request #1503 from mohaidoss/tests/core-pkg-policyhandler
Adding Test Suite for core/pkg/policyhandler
2023-11-24 09:45:36 +01:00
Mehdi Moussaif
362375a733 Adding Test Suite for core/pkg/policyhandler
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-24 00:35:23 +01:00
cbrom
92d39c5abc added a generated docstring for CalculateFixed function
Signed-off-by: cbrom <kb.cbrom@gmail.com>
2023-11-23 22:33:10 +03:00
Matthias Bertschy
c4f0e6e46b Merge pull request #1500 from sulemaanhamza/bugfix-core-pkg-fixhandler-yamlhelper-edgecases
Edge-case Handling and Test Enhancements in yamlhelper
2023-11-23 17:12:44 +01:00
Matthias Bertschy
6fcfe7f4e5 Merge pull request #1497 from sulemaanhamza/bugfix-core-list-gencontrolrows
Fix for Index Out of Range Error in Malformed Policies Handling
2023-11-23 17:09:58 +01:00
Matthias Bertschy
633024f8c5 Merge pull request #1498 from kubescape/severity
add one test for imagescan to avoid coverage check failure
2023-11-23 16:45:30 +01:00
Matthias Bertschy
92a4c1f64a add one test for imagescan, delete patch_test to avoid coverage check failure
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-11-23 15:14:52 +01:00
sulemaanhamza
1f43de06f8 Implemented Ai suggested changes
Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2023-11-23 18:40:42 +05:00
Matthias Bertschy
5d5ac5c5d5 Merge pull request #1474 from kubescape/fix-install
fix install.sh when sudo is required to delete /usr/local/bin/kubescape
2023-11-23 14:33:24 +01:00
sulemaanhamza
04b06d875b Added edge-case test cases for yamlhelper, fixed bugs cause test-cases to fail
Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2023-11-23 17:21:09 +05:00
Matthias Bertschy
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
Yuval Leibovich
3b78169f8c Update loadmocks.go
remove armobuildin obj. from regolibrary 

Signed-off-by: Yuval Leibovich <89763818+yuleib@users.noreply.github.com>
2023-11-23 13:29:27 +02:00
Matthias Bertschy
ba7317b4eb Merge pull request #1496 from VaibhavMalik4187/core-pkg-tests
Adding Unit Tests for core/pkg Package
2023-11-23 12:04:01 +01:00
Matthias Bertschy
85b8648724 fix install.sh when sudo is required to delete /usr/local/bin/kubescape
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-11-23 10:35:12 +01:00
VaibhavMalik4187
55162829e7 Added Test Suite for core/pkg package
Added unit tests for the following files:
- containerscan/datastructures.go
- hostsensorutils/hostsensordeploy.go
- hostsensorutils/hostsensorworkerpool.go
- hostsensorutils/utils.go
- policyhandler/handlepullpolicies.go
- policyhandler/handlepullpoliciesutils.go
- resourcehandler/filesloader.go
- resourcehandler/remotegitutils.go

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-23 14:19:13 +05:30
Matthias Bertschy
27590f623f Merge pull request #1495 from sulemaanhamza/pkg-yamlhelper-test-suite
Adding Comprehensive Test Suite for yamlhelper Package
2023-11-23 09:24:51 +01:00
sulemaanhamza
bc2fc83599 Enhanced policies list to cover multiple edge-cases + Added new test-case with table-like structure to test pretty print of rows
Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2023-11-23 13:15:31 +05:00
Matthias Bertschy
cb78723a96 Merge pull request #1494 from cbrom/core_cautils_datastructuremethods_tests
Code Improvement on isRuleKubescapeVersionCompatible function
2023-11-23 09:01:46 +01:00
sulemaanhamza
a513c27dce Possible bug fix to prevent index out of range error in case of malformed policies + test case for edge cases
Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2023-11-23 12:36:54 +05:00
suleman
f814d1df19 Added Test Suite for core/pkg/fixhandler/yamlhelper
Signed-off-by: sulemaanhamza <sulemanhamza97@gmail.com>
2023-11-23 12:33:51 +05:00
Cbrom
5455855e65 Merge branch 'kubescape:master' into core_cautils_datastructuremethods_tests 2023-11-22 22:13:58 +03:00
Matthias Bertschy
eff7f36866 Merge pull request #1480 from VaibhavMalik4187/interrupt-signal-fix
Implementation of Interrupt Signal Handler
2023-11-22 17:52:41 +01: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
43dbb4ac70 Merge pull request #1484 from VaibhavMalik4187/core-core-tests
Added Test Suite for core/core Package
2023-11-22 17:26:31 +01:00
Matthias Bertschy
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
Matthias Bertschy
8cacd4d984 Merge pull request #1472 from kubescape/bump
bump for security fixes
2023-11-22 16:58:15 +01:00
Matthias Bertschy
1342a06f43 Merge pull request #1477 from mohaidoss/master
Adding Test Suite for core/pkg/score
2023-11-22 16:36:51 +01:00
VaibhavMalik4187
55da8c1ce2 Added signal handler for the interrupt signal
- Subscribing to an interrupt signal handler allows graceful shutdown of
  the program.
- Use exit code 130 for interrupt signals.

Fixes: https://github.com/kubescape/kubescape/issues/1476

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-22 20:51:19 +05:30
Matthias Bertschy
6adfef2a48 Merge pull request #1483 from VaibhavMalik4187/core-cautils-tests
Added Test Suite for cautils
2023-11-22 15:58:22 +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
Matthias Bertschy
8827434cce Merge pull request #1485 from mohaidoss/tests/go-tree
Adding Test Suite for core/pkg/resultshandling/gotree
2023-11-22 15:53:19 +01:00
VaibhavMalik4187
9845175d29 Added tests for the core/core package
Wrote tests for the following files:
- kscore.go
- list.go
- patch.go
- scan.go

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-22 20:03:27 +05:30
Matthias Bertschy
ddf01648b4 Merge pull request #1490 from VaibhavMalik4187/binary-build-workflow-update
Run binary-build job only for kubescape/kubscape
2023-11-22 14:19:56 +01:00
VaibhavMalik4187
16f4849323 Run binary-build job only for kubescape/kubscape
Added a check before running the binary-build job to ensure that the
owner of the repository is kubescape.

Fixes: https://github.com/kubescape/kubescape/issues/1482

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-22 15:12:36 +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
Oshrat Nir
ec40320a2d update readme
Signed-off-by: Oshrat Nir <oshratn@armosec.io>
2023-11-22 09:56:14 +02: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
Mehdi Moussaif
c7f9a6ebc4 Adding Test Suite for core/pkg/resultshandling/gotree
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Additional tests for core/pkg/gotree

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

tests for printItem in core/pkg/gotree

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Refactor printer initialization in gotree_test.go

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-21 20:32:11 +01:00
Mehdi
a2f632beb4 Test suite for core/pkg/score
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Use cautils for mock data

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Removed test TestNewScoreWrapperWithNilOPASessionObj

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>
2023-11-21 16:35:09 +01:00
Matthias Bertschy
567698356e Merge pull request #1481 from mohaidoss/unknown-version-fix
Fix for Empty Build Number in cmd Version
2023-11-21 15:00:54 +01:00
Mehdi Moussaif
887f6a0d0e fix(cmd version): show unknown when BuildNumber is empty
Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Use cobra's OutOrStdout instead of os.Stdout

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Test cmd version output

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Apply recommanded changes

Signed-off-by: Mehdi Moussaif <m.moussaif42@gmail.com>

Unneeded if and print statement
2023-11-21 14:04:37 +01:00
Amir Malka
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
Matthias Bertschy
8b596ec951 Merge pull request #1478 from VaibhavMalik4187/update-tablewriter-version
Update the tablewriter version to latest
2023-11-21 07:41:36 +01:00
VaibhavMalik4187
4863edc042 Update the tablewriter version to latest
Fixes: https://github.com/kubescape/kubescape/issues/1452

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-11-21 11:23:12 +05:30
Matthias Bertschy
dc6d85bc34 bump for security fixes
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-11-14 09:55:53 +01:00
Matthias Bertschy
1c48636155 Merge pull request #1469 from ibidani/patch-1
Adding Cox Communications Adopters
2023-11-08 18:22:38 +01:00
Idan Bidani
bd5f8a9439 Adding Cox Communications Adopters
Signed-off-by: Idan Bidani <iplaman@gmail.com>
2023-11-08 12:20:14 -05:00
Matthias Bertschy
18850b8d41 Merge pull request #1468 from dirien/patch-1
Update ADOPTERS.md
2023-11-08 13:39:23 +01:00
Engin Diri
47bab2a9ed Update ADOPTERS.md
Add Schwarz IT to adopters list

Signed-off-by: Engin Diri <info@ediri.de>
2023-11-08 13:32:18 +01:00
Matthias Bertschy
9e8b11c34f Merge pull request #1467 from kubescape/craigbox-affiliation
Update MAINTAINERS.md
2023-11-08 00:45:54 +01:00
Craig Box
74bfb57d3a Update MAINTAINERS.md
Change my affiliation

Signed-off-by: Craig Box <craigb@armosec.io>
2023-11-08 12:34:58 +13:00
David Wertenteil
9fb56a2856 Merge pull request #1464 from kubescape/remove-config-tests
Remove deprecated tests
2023-11-06 08:12:06 -05:00
David Wertenteil
9a098c59df Merge pull request #1457 from johnfercher/master
Update maroto version from 0.42.0 to 1.0.0
2023-11-01 21:57:28 +02:00
David Wertenteil
c781bc3166 remove deprecated tests
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-11-01 16:33:25 +02:00
John Fercher
a027a3d3d5 * Update maroto version from 0.42.0 to 1.0.0
Signed-off-by: John Fercher <johnathanfercher22@gmail.com>
2023-10-31 23:02:59 -03:00
Craig Box
ee37dc499b Merge pull request #1463 from kubescape/bump-logger 2023-11-01 09:53:00 +13:00
David Wertenteil
450df679cd bump logger version
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-10-31 18:22:03 +02:00
Craig Box
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
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
Matthias Bertschy
edfc5d5949 fix docker build for kubescape-cli
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-26 22:39:09 +02:00
David Wertenteil
e00c7722f1 Merge pull request #1454 from kubescape/update-backend-pkg
Bump backend pkg
2023-10-26 23:22:55 +03:00
David Wertenteil
fd2fc3db34 Merge pull request #1453 from kubescape/delete-dup-related
avoid adding duplicate related resource IDs
2023-10-26 23:04:16 +03:00
David Wertenteil
5111bb541a bump pkg
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-10-26 18:10:40 +03:00
YiscahLevySilas1
1d25415c21 avoid adding duplicate related resource IDs
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-10-26 12:52:05 +03:00
David Wertenteil
a423b41e68 update docs
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-10-23 09:49:57 +03:00
David Wertenteil
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
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
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
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
Daniel Grunberger
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
a938b3523f Merge pull request #1446 from kubescape/deps-policy
add env-dependencies-policy to security insights
2023-10-20 09:32:51 +02:00
Matthias Bertschy
915d5d993b add env-dependencies-policy to security insights
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-20 09:30:41 +02:00
rcohencyberarmor
e2044338c8 print result to stdout when format argument specified (#1438)
* print result to stdout when format argument specified

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* print pretty format to stdout if format is not specified

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* remove not relevant log

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

---------

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Co-authored-by: rcohencyberarmor <rcohen@armosec.io>
2023-10-19 13:07:58 +03:00
Matthias Bertschy
e4110837c7 Merge pull request #1443 from kubescape/sarif-format
image scanning - replace driver name in sarif format
2023-10-18 14:33:40 +02:00
Matthias Bertschy
33452517fe Merge pull request #1444 from kubescape/actions
add more missing permissions for actions
2023-10-18 14:32:29 +02:00
Matthias Bertschy
df602af7cf add more missing permissions for actions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-18 12:41:04 +02:00
Daniel Grunberger
bc327a0d86 set log to error
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-10-18 12:23:46 +03:00
Daniel Grunberger
77888c12a0 rm if statement
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-10-18 12:22:59 +03:00
Daniel Grunberger
df56af843e replace driver name
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-10-18 12:18:53 +03:00
David Wertenteil
1f6ffdfd24 Merge pull request #1441 from kubescape/act
actions needs write on id-token in pr-scanner
2023-10-18 09:21:28 +03:00
Matthias Bertschy
6a0a7b84a2 actions needs write on id-token in pr-scanner
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-18 07:28:52 +02:00
Matthias Bertschy
f4bb8485cd Merge pull request #1436 from kubescape/ghactions
use distroless debug as entrypoint.sh requires a shell
2023-10-17 16:25:32 +02:00
David Wertenteil
33ec257aa8 Merge pull request #1439 from kubescape/bump
bump deps for vulnerabilities
2023-10-17 15:54:15 +03:00
Matthias Bertschy
f31304db7e bump deps for vulnerabilities
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-17 14:36:26 +02:00
Matthias Bertschy
b98d80a912 Merge pull request #1421 from kubescape/winwin
build windows exec without libgit
2023-10-17 10:09:32 +02:00
Matthias Bertschy
ae7b25a9ae Merge pull request #1437 from kubescape/act
fixing GH actions permissions
2023-10-17 10:05:49 +02:00
Matthias Bertschy
4f2d13b151 fixing GH actions permissions
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-17 09:53:46 +02:00
Matthias Bertschy
b6b4d6bb46 use distroless debug as entrypoint.sh requires a shell
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-17 09:42:59 +02:00
Matthias Bertschy
de76c98231 Merge pull request #1435 from kubescape/act
remove extra permissions on GH action
2023-10-17 08:31:07 +02:00
Matthias Bertschy
0b7d8cd45e remove extra permissions on GH action
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-17 07:36:38 +02:00
Matthias Bertschy
48c86037fd Merge pull request #1433 from kubescape/artifacthub
add ArtifactHub to README
2023-10-16 17:36:45 +02:00
Matthias Bertschy
69b28823d9 add ArtifactHub to README
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-16 16:27:38 +02:00
Matthias Bertschy
554286e803 Merge pull request #1432 from kubescape/fossa
add FOSSA badge to README
2023-10-16 14:32:38 +02:00
Matthias Bertschy
971e775476 add FOSSA badge to README
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-16 14:20:12 +02:00
Matthias Bertschy
95133af9f4 build windows exec without libgit
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-16 11:16:30 +02:00
Matthias Bertschy
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
David Wertenteil
a5d1fa3f66 Merge pull request #1274 from nvuillam/patch-1
Update installation.md to add instructions to install a previous version
2023-10-15 12:02:30 +03:00
David Wertenteil
3d71246580 Merge pull request #1430 from kubescape/token
add top level permissions: read-all for openssf
2023-10-15 11:58:54 +03:00
YiscahLevySilas1
31a0bd9266 use ControlConfigInputs, deprecate ConfigInputs (#1419)
* use ControlConfigInputs, deprecate ConfigInputs

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update opa-utils version

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-10-15 11:58:10 +03:00
Matthias Bertschy
143a4d9818 add top level permissions: read-all for openssf
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-13 15:20:52 +02:00
Matthias Bertschy
0d889bf454 Merge pull request #1429 from kubescape/ssf
correct security-insights stage -> status
2023-10-13 07:41:07 +02:00
Matthias Bertschy
f7a5f76285 correct security-insights stage -> status
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-13 07:31:55 +02:00
Matthias Bertschy
1e527b4174 Merge pull request #1428 from slashben/security-slam
Fix in the README for changelog name
2023-10-13 07:08:24 +02:00
Ben
5bf1d6b3c4 Fix in the README for changelog name
Signed-off-by: Ben <ben@armosec.io>
2023-10-12 22:24:36 +03:00
Matthias Bertschy
f622bd0a0e Merge pull request #1422 from kubescape/dependabot/go_modules/httphandler/golang.org/x/net-0.17.0
Bump golang.org/x/net from 0.14.0 to 0.17.0 in /httphandler
2023-10-12 16:59:01 +02:00
Ben Hirschberg
f70cf68e4d Merge pull request #1427 from slashben/security-slam
Adding project security and governance as per maintainer decision
2023-10-12 17:19:19 +03:00
Ben
accc8a3834 Adding project security and governance as per maintainer decision
Signed-off-by: Ben <ben@armosec.io>
2023-10-12 17:14:28 +03:00
Matthias Bertschy
83b6686496 Merge pull request #1426 from kubescape/Adding-scorecard-badge
Adding scorecard badge
2023-10-12 15:56:26 +02:00
David Wertenteil
934f72203e Update README.md
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-10-12 16:50:43 +03:00
David Wertenteil
506da9dc22 Merge pull request #1425 from kubescape/scorecard
Create scorecard.yml
2023-10-12 16:40:49 +03:00
David Wertenteil
2cfd4f3b31 Create scorecard.yml
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-10-12 16:39:38 +03:00
dependabot[bot]
7aa7a9bbda Bump golang.org/x/net from 0.14.0 to 0.17.0 in /httphandler
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-12 12:25:57 +00:00
Matthias Bertschy
5968f97583 Merge pull request #1417 from kubescape/fixtests
drop build tags for tests (will soon deprecate them)
2023-10-11 17:25:54 +02:00
Matthias Bertschy
6070f0f126 Merge pull request #1418 from kubescape/fixci
use correct variable for IMAGE_TAG
2023-10-11 16:17:23 +02:00
Matthias Bertschy
a52ca0e47d use correct variable for IMAGE_TAG
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-11 16:05:55 +02:00
Matthias Bertschy
2da0293ee2 Merge pull request #1416 from kubescape/fixci
add missing dependency on retag in binary-build
2023-10-11 14:18:59 +02:00
Matthias Bertschy
ed1219baf1 drop build tags for tests (will soon deprecate them)
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-11 14:03:53 +02:00
Matthias Bertschy
f073ce0f42 add missing dependency on retag in binary-build
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-11 13:56:50 +02:00
Matthias Bertschy
9e6efd04ce Merge pull request #1413 from VaibhavMalik4187/remove-codesee-workflow
Removed the Codesee workflow
2023-10-10 07:29:11 +02:00
VaibhavMalik4187
8908a4e8cf Removed the Codesee workflow
Fixes: https://github.com/kubescape/kubescape/issues/1405

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
2023-10-10 07:38:51 +05:30
Matthias Bertschy
425f278300 Merge pull request #1412 from kubescape/fixci
force docker-build in absence of release label
2023-10-09 11:04:59 +02:00
Matthias Bertschy
5b1aa1501f force docker-build in absence of release label
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-09 10:13:53 +02:00
David Wertenteil
9bb2136ada Merge pull request #1411 from kubescape/fixed-wf
Adding check-secret to build image wf
2023-10-08 12:42:14 +03:00
David Wertenteil
bbabd5373a Adding check-secret to build image wf
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-10-08 12:18:19 +03:00
Matthias Bertschy
24c48ab58f Merge pull request #1407 from kubescape/dependabot/go_modules/github.com/cyphar/filepath-securejoin-0.2.4
Bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4
2023-10-05 10:26:13 +02:00
dependabot[bot]
fd6347fac2 Bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-10-02 17:41:05 +02:00
YiscahLevySilas1
269945c08c split failedPath to deletePaths and reviewPaths (#1402)
* support delete paths and review paths

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update armoapi + opa-utils

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix test

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* go mod tidy

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* support failedPaths until all controls replace with review/delete paths

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix test

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix test

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-10-02 17:03:02 +03:00
Rotem Refael
10c7c428e4 add Openssf badge (#1400)
* add Openssf badge

Signed-off-by: rotemamsa <rotem@armosec.io>
2023-09-28 13:23:17 +02:00
Matthias Bertschy
34f0b64946 Merge pull request #1399 from kubescape/noratelimit
disable rate limiting for storage client
2023-09-27 17:07:45 +02:00
rcohencyberarmor
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
Matthias Bertschy
e97103494f disable rate limiting for storage client
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-09-21 16:32:28 +02:00
Matthias Bertschy
3e7a6b516b Separate docker builds for kubescape and kubescape-cli (#1390)
* create a separate Dockerfile for httphandler

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* add Dockerfile for cli, edit README

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* modify gh action to use new cli Dockerfile

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

---------

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-09-18 17:13:08 +03:00
Amir Malka
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
David Wertenteil
bfc2304a95 Merge pull request #1388 from kubescape/remove-armo-url
Remove ARMO server url
2023-09-13 14:26:41 +03:00
Daniel Grunberger
96337edc67 add new line (#1389)
* add new line

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* rename ks-cloud-operator

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-13 14:26:11 +03:00
DRAGON2002
a3f80d91bf fix: format headers (#1383)
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-09-13 13:27:56 +03:00
Amir Malka
69c84cdf56 remove ARMO server url
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-09-13 09:43:38 +03:00
David Wertenteil
a6cca30eb0 Merge pull request #1381 from XDRAGON2002/issue_1380
feat: darken table borders
2023-09-11 12:09:17 +03:00
DRAGON
c74c5f1970 feat: darken table borders
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-09-10 21:48:15 +05:30
David Wertenteil
e611cec238 Merge pull request #1379 from kubescape/fix-kubecontext-for-httphandler
fix setting context name in httphandler
2023-09-10 16:17:36 +03:00
Amir Malka
4372ca320a fix setting context name in httphandler
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-09-10 16:16:01 +03:00
David Wertenteil
c490dcc9cb Merge pull request #1372 from kubescape/fix-image-printer
Print up until 4 images in vulnerability summary
2023-09-07 10:08:04 +03:00
Amir Malka
c914ab1034 revert e2e test branch (#1373)
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-09-05 14:31:56 +03:00
Daniel Grunberger
b39ce4caae print up until 4 imgs
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-09-05 11:47:44 +03:00
David Wertenteil
076aa7f8fe Merge pull request #1370 from kubescape/provide-log-msg
validate sarif format
2023-09-03 18:41:10 +03:00
Daniel Grunberger
df035ea5fc Fix scan command (#1369)
* bump version

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* bump version for httphandler

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* fix args validation

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* errors as const

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 17:22:14 +03:00
Daniel Grunberger
58553688e9 validate sarif format
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-09-03 16:51:52 +03:00
Daniel Grunberger
776173653d bump version (#1368)
* bump version

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* bump version for 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 15:31:57 +03:00
Daniel Grunberger
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
Vicky Aryan
6a8a338945 Error Fixed when downloading on azure cloud vm environment (#720)
* install.ps1 is modified

* cloud vm error fixed
2023-09-01 08:03:12 +03:00
Daniel Grunberger
53f23b663b Logger fixes (#1362)
* fix rbac log

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* fix logger logic

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* use const

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* use const for zap

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-08-30 19:17:41 +03:00
Amir Malka
592e0e2b43 Service discovery (#1359)
* remove hardcoded urls

Signed-off-by: Amir Malka <amirm@armosec.io>

* update

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix test

Signed-off-by: Amir Malka <amirm@armosec.io>

* update providers docs

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix

Signed-off-by: Amir Malka <amirm@armosec.io>

* hardcoded systests branch

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix

Signed-off-by: Amir Malka <amirm@armosec.io>

* added logs

Signed-off-by: Amir Malka <amirm@armosec.io>

* added logs

Signed-off-by: Amir Malka <amirm@armosec.io>

* create config path if it does not exist

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix

Signed-off-by: Amir Malka <amirm@armosec.io>

---------

Signed-off-by: Amir Malka <amirm@armosec.io>
2023-08-30 09:54:50 +03:00
David Wertenteil
92449bf564 core(cmd): adding corrections to cmd (#1357)
* adding corrections to cmd

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* remove decorative line

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: changed results indicator

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* replace status test with icons

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* print workloads in a different line

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update display

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* deprecate commands

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* removed unused functions

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed tests

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update cloud provider detection

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* rename column name

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-29 09:50:22 +03:00
David Wertenteil
8d1547163b Beautify install.sh script logs (#1356)
* Check k8s access before running

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* refactor script

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed color background

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-24 15:18:10 +03:00
David Wertenteil
d16abf376d Merge pull request #1335 from kubescape/dwertent-patch-1
Create dependabot.yaml
2023-08-24 10:27:58 +03:00
Amir Malka
150967eae8 Refactor backend integration (#1355)
* refactor BE integration

Signed-off-by: Amir Malka <amirm@armosec.io>
2023-08-23 15:36:08 +03:00
Daniel Grunberger
150dc61ec7 fix panic & provide msg (#1353)
* fix pani & provide msgf

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* support sarif

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* new line

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* validate format

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* refactor

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* validate printer tests

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* use sarif const

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* small refactor

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* unify switch

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-08-22 15:22:57 +03:00
Daniel Grunberger
7b46cdd480 Improve cluster scan cli (#1352)
* start improvements

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* cta

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* refactor

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* fixes

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* http handler go mod

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* set control type

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* move to func

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* move to func

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* use color for vuln summary

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-08-22 15:21:01 +03:00
YiscahLevySilas1
b67fd95e31 support paths from related resources (#1351)
* support paths from related resources

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix test

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-08-22 08:06:45 +03:00
Daniel Grunberger
f7b3cdcf35 Improve logs (#1349)
* use stop-success

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* improve logger

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* RBAC

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-08-17 14:18:40 +03:00
Daniel Grunberger
d6a47a82d2 improve cli output (#1347)
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-08-16 13:01:32 +03:00
Daniel Grunberger
936cb26c06 fix panic and improve logs (#1344)
Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-08-16 13:00:52 +03:00
DRAGON2002
9265a5d6d0 fix: icons formatting (#1343)
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-08-16 12:58:55 +03:00
Daniel Grunberger
e6f5c7e0dd bump k8s-interface version (#1345)
* bump version

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* bump 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-08-15 10:34:45 +03:00
rcohencyberarmor
4e48148d40 Support unified configuration (#1304)
* support scanning scope

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go mod

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update white list

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go mod

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* scope empty return control should tested

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update rego scope for system test

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update test + mock

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add comment

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update rego library

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update k8s-interface

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update opa utils - lots of file changes in this commit since armoapi-go bump up in opa-utils

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* move to temp k8s-interface - till PR in k8s-interface repo will approved

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update k8s-interface with released tag

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go mod in httphandler

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* support unified configuration

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* unitest adjustment

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* config-unified

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* CR corrections

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* remove system test till it will be merged

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add relevant system test

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* remove delete test

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* return config delete system test

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

---------

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Co-authored-by: rcohencyberarmor <rcohen@armosec.io>
2023-08-15 10:34:23 +03:00
David Wertenteil
3648ef286d Merge pull request #1341 from XDRAGON2002/issue_1339
feat: migrate fatih/color to gchalk
2023-08-13 07:56:05 +03:00
DRAGON
d946662e57 feat: migrate fatih/color to gchalk
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-08-11 04:31:39 +05:30
David Wertenteil
51b37d5cbf Update logs (#1340)
* update logger

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed logger

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* bump go-logger version

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-10 19:15:14 +03:00
DRAGON2002
9afae713ba feat: add table heading colors (#1321)
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-08-10 19:14:38 +03:00
Matthias Bertschy
1d64522607 use distroless base image (#1338)
* use distroless base image

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* bump cosign to v2

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

---------

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-08-10 15:46:07 +03:00
DRAGON2002
225a923006 feat: improve pretty logger (#1311)
* feat: improve pretty logger

Signed-off-by: DRAGON <anantvijay3@gmail.com>

* fixed logger

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: DRAGON <anantvijay3@gmail.com>
Signed-off-by: Craig Box <craigb@armosec.io>
Signed-off-by: David Wertenteil <dwertent@armosec.io>
Co-authored-by: Craig Box <craigb@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-08-09 17:30:04 +03:00
DRAGON2002
6c1a3fb89b feat: add short table (#1292)
Signed-off-by: DRAGON <anantvijay3@gmail.com>
Signed-off-by: DRAGON2002 <81813720+XDRAGON2002@users.noreply.github.com>
2023-08-09 16:56:58 +03:00
DRAGON2002
df5f7db51d feat: change colors library (#1316)
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-08-09 09:48:34 +03:00
DRAGON2002
35c593a624 chore: update docs build.ps1 (#1299)
* chore: update docs build.ps1

Signed-off-by: DRAGON <anantvijay3@gmail.com>

* Fix build.ps1 for CI

Signed-off-by: Songlin Jiang <songlin.jiang@csc.fi>

---------

Signed-off-by: DRAGON <anantvijay3@gmail.com>
Signed-off-by: Songlin Jiang <songlin.jiang@csc.fi>
Co-authored-by: Songlin Jiang <songlin.jiang@csc.fi>
2023-08-09 09:27:35 +03:00
DRAGON2002
869f0ea109 feat: add unicode table (#1285)
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-08-09 09:26:37 +03:00
David Wertenteil
cf08daf7fb scan per namespace (#1337)
* scan per namespace

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* disable unit test

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Adding build image wf

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* removing unused channels

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* adding scopes

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed cluster size

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update rbac deps

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* aggregate resources

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Delete build-image.yaml

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* adding scan image logs

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update cmd message

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* update logs

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-08 10:47:15 +03:00
Ben Hirschberg
266029eb23 Implementing container image name normalization built-in function for Rego (#1334)
* Implementing container image name normalization built-in function for Rego

Signed-off-by: Ben <ben@armosec.io>

* updating go.mod t include docker/distribution

Signed-off-by: Ben <ben@armosec.io>

* fix test

Signed-off-by: Ben <ben@armosec.io>

---------

Signed-off-by: Ben <ben@armosec.io>
2023-08-08 09:35:32 +03:00
rcohencyberarmor
4c9fec8ef4 Support scanning scope (#1293)
* support scanning scope

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go mod

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update white list

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go mod

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* scope empty return control should tested

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update rego scope for system test

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update test + mock

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add comment

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update rego library

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update k8s-interface

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update opa utils - lots of file changes in this commit since armoapi-go bump up in opa-utils

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* move to temp k8s-interface - till PR in k8s-interface repo will approved

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update k8s-interface with released tag

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go mod in httphandler

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* PR review corrections

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* change test name

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* scanning scope support for framework

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* test/mock adjustments after merge

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add more informative log to the user

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update go.mod and go.sum of the http handler

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* remove framework just scanning scope not matched to framework config scope

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add system tests to workflow

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add system test to github workflow

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

---------

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Signed-off-by: David Wertenteil <dwertent@armosec.io>
Co-authored-by: rcohencyberarmor <rcohen@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-08-07 19:11:14 +03:00
David Wertenteil
b88e4f6169 Create dependabot.yaml
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-07 16:48:46 +03:00
David Wertenteil
6f07e63d3f Hotfix for version 2.3.8 (#1333)
* update wf

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed tag

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* build arm64

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: revert release changes

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: adding build-image wf

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* adding platforms to wf

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-06 12:23:49 +03:00
David Wertenteil
addd66bf72 Merge pull request #1327 from dwertent/hot-fix-submit-timestamp
Fix submit time
2023-08-04 19:24:27 +03:00
Amir Malka
e2f96200e0 Code refactor (follow up to PR #1300) (#1323)
* code refactor

Signed-off-by: Amir Malka <amirm@armosec.io>

* use scaninfo object in resource handler

Signed-off-by: Amir Malka <amirm@armosec.io>

---------

Signed-off-by: Amir Malka <amirm@armosec.io>
2023-08-03 17:50:33 +03:00
David Wertenteil
f799b63684 Merge pull request #1331 from kubescape/fix-httphandler-go-mod-anchore
fix(httphandler): pin breaking anchore dependency
2023-08-03 17:49:41 +03:00
Vlad Klokun
a088219954 fix(httphandler): pin breaking anchore dependency
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-08-03 17:36:27 +03:00
David Wertenteil
1a2e16b895 Update PR workflow (#1330)
* fixed wf call

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* do not wait for pr checks

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* fixed typo

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-03 17:25:22 +03:00
David Wertenteil
7444acae11 Merge pull request #1312 from XDRAGON2002/issue_1282
fix: negative compliance score
2023-08-03 14:32:47 +03:00
David Wertenteil
8294694e09 Merge pull request #1277 from XDRAGON2002/issue_1176
fix: kubescape list controls
2023-08-03 14:30:12 +03:00
David Wertenteil
12d7f18b79 Merge pull request #1329 from kubescape/codesee-wf
Update codesee-arch-diagram.yml
2023-08-03 14:05:34 +03:00
David Wertenteil
83279484bd Merge pull request #1328 from kubescape/remove-label-condition
Remove label condition in PR scanner workflow
2023-08-03 14:05:08 +03:00
David Wertenteil
ba134ebc32 Update codesee-arch-diagram.yml
Run codesee only on `.go` files

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-03 13:52:27 +03:00
David Wertenteil
b44f0a76c9 Update 00-pr-scanner.yaml
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-03 13:49:34 +03:00
David Wertenteil
226b4772a2 fix submit time
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-03 13:26:49 +03:00
Daniel Grunberger
5379b9b0a6 New output (#1320)
* phase-1

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* factory

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* wip: feat(cli): add an image scanning command

Add a CLI command that launches an image scan. Does not scan images yet.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* wip: feat: add image scanning service

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* chore: include dependencies

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* wip: adjust image scanning service

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* wip: feat: use scanning service in CLI

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* use iface

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* touches

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* continue

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* add cmd

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* support single workload scan

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix conflict

Signed-off-by: Amir Malka <amirm@armosec.io>

* identifiers

* go mod

* feat(imagescan): add an image scanning command

This commit adds a CLI command and an associated package that scan
images for vulnerabilities.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

feat(imagescan): fail on exceeding the severity threshold

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* chore(imagescan): include dependencies

This commit adds the dependencies necessary for image scanning.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* chore(imagescan): add dependencies to httphandler

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* added unit tests

Signed-off-by: Amir Malka <amirm@armosec.io>

* merge

* more

* integrate img scan

* added unit tests

Signed-off-by: Amir Malka <amirm@armosec.io>

* more refactoring

Signed-off-by: Amir Malka <amirm@armosec.io>

* add scanned workload reference to opasessionobj

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix GetWorkloadParentKind

Signed-off-by: Amir Malka <amirm@armosec.io>

* remove namespace argument from pullSingleResource, using field selector instead

Signed-off-by: Amir Malka <amirm@armosec.io>

* removed designators (unused) field from PolicyIdentifier, and designators argument from GetResources function

Signed-off-by: Amir Malka <amirm@armosec.io>

* changes

* changes

* fixes

* changes

* feat(imagescan): add an image scanning command

This commit adds a CLI command and an associated package that scan
images for vulnerabilities.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

feat(imagescan): fail on exceeding the severity threshold

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* chore(imagescan): include dependencies

This commit adds the dependencies necessary for image scanning.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* chore(imagescan): add dependencies to httphandler

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* chore(imagescan): create vuln db with dedicated function

Remove commented out code, too.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* docs(imagescan): provide package-level docs

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

* finish merge

* image scan tests

* continue

* fixes

* refactor

* rm duplicate

* start fixes

* update gh actions

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* pr fixes

* fix test

* improvements

---------

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
Signed-off-by: Amir Malka <amirm@armosec.io>
Signed-off-by: David Wertenteil <dwertent@armosec.io>
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io>
Co-authored-by: Vlad Klokun <vklokun@protonmail.ch>
Co-authored-by: Amir Malka <amirm@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-08-03 12:09:33 +03:00
David Wertenteil
98f68d8097 Merge pull request #1319 from kubescape/codesee-arch-diagram-workflow-1690964652908
Install the CodeSee workflow.
2023-08-03 10:14:47 +03:00
David Wertenteil
f8057b5c79 Merge pull request #1322 from kubescape/add-ai-workflow
Adding pr-agent
2023-08-02 16:29:25 +03:00
David Wertenteil
f36d8c31b0 Adding pr-agent
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-02 16:27:16 +03:00
Vlad Klokun
3abf18acb7 Merge pull request #1288 from kubescape/feat-image-scan-svc
feat: add an image scanning service and CLI command
2023-08-02 14:03:50 +03:00
codesee-maps[bot]
28200b2744 Install the CodeSee workflow. Learn more at https://docs.codesee.io 2023-08-02 08:24:13 +00:00
David Wertenteil
678f21e33c Merge pull request #1317 from kubescape/add-prints-to-smoketest
add prints to smoketest
2023-08-02 09:55:43 +03:00
Amir Malka
467a84ddac add prints to smoketest
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-08-02 09:52:01 +03:00
Vlad Klokun
925145724e docs(imagescan): provide package-level docs
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-08-02 09:50:18 +03:00
Vlad Klokun
e3677fc45c chore(imagescan): create vuln db with dedicated function
Remove commented out code, too.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-08-02 09:50:17 +03:00
Vlad Klokun
704de5bfc1 chore(imagescan): add dependencies to httphandler
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-08-02 09:50:17 +03:00
Vlad Klokun
2494c1971c chore(imagescan): include dependencies
This commit adds the dependencies necessary for image scanning.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-08-02 09:50:17 +03:00
Vlad Klokun
3b8bd7735e feat(imagescan): add an image scanning command
This commit adds a CLI command and an associated package that scan
images for vulnerabilities.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>

feat(imagescan): fail on exceeding the severity threshold

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-08-02 09:50:17 +03:00
David Wertenteil
602591e7f2 Merge pull request #1315 from kubescape/remove-workload-cmd
remove scan workload command
2023-08-02 08:44:15 +03:00
Amir Malka
e276e54d2b remove scan workload command
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-08-01 14:11:16 +03:00
Amir Malka
0c019819ff Scanning a single resource (#1300)
* add cmd

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>

* support single workload scan

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix conflict

Signed-off-by: Amir Malka <amirm@armosec.io>

* added unit tests

Signed-off-by: Amir Malka <amirm@armosec.io>

* added unit tests

Signed-off-by: Amir Malka <amirm@armosec.io>

* more refactoring

Signed-off-by: Amir Malka <amirm@armosec.io>

* add scanned workload reference to opasessionobj

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix GetWorkloadParentKind

Signed-off-by: Amir Malka <amirm@armosec.io>

* remove namespace argument from pullSingleResource, using field selector instead

Signed-off-by: Amir Malka <amirm@armosec.io>

* removed designators (unused) field from PolicyIdentifier, and designators argument from GetResources function

Signed-off-by: Amir Malka <amirm@armosec.io>

* fix tests

Signed-off-by: Amir Malka <amirm@armosec.io>

* use ScanObject instead of workload identifier

Signed-off-by: Amir Malka <amirm@armosec.io>

* refactor logic after CR

Signed-off-by: Amir Malka <amirm@armosec.io>

---------

Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io>
Signed-off-by: Amir Malka <amirm@armosec.io>
Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io>
2023-08-01 14:07:31 +03:00
David Wertenteil
d9e946cf6d reset head (#1306)
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-08-01 10:47:07 +03:00
David Wertenteil
e3a8ebfe05 Merge pull request #1297 from dwertent/update-armo-docs
docs(providers): Update ARMO docs
2023-07-31 19:37:01 +03:00
David Wertenteil
fd3703b21b Merge pull request #1296 from kubescape/error-handle-for-empty-resource-scan
Error handle for empty resource scan
2023-07-31 16:13:42 +03:00
David Wertenteil
6bcdda7d56 Merge pull request #1309 from amirmalka/bump-dependencies
bump opa-utils
2023-07-31 12:11:26 +03:00
Amir Malka
981430d65f bump opa-utils
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-07-31 12:00:52 +03:00
David Wertenteil
e91ec69832 Merge pull request #1307 from amirmalka/bump-dependencies
Bump dependencies
2023-07-31 11:02:05 +03:00
Amir Malka
bbfa5d356a bump opa-utils, k8s-interface and armoapi-go
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-07-31 10:39:03 +03:00
DRAGON
d2af7f47db fix: negative compliance score
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-07-31 00:21:01 +05:30
rcohencyberarmor
d28afcb00c linter correction
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
2023-07-30 15:46:54 +03:00
rcohencyberarmor
ca6bdb0bef review corrections
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
2023-07-30 12:06:03 +03:00
Raziel Cohen
e424bfa81b Merge branch 'master' of github.com:kubescape/kubescape into error-handle-for-empty-resource-scan 2023-07-30 11:21:53 +03:00
David Wertenteil
9f1ff4c090 Merge pull request #1279 from XDRAGON2002/issue_760
feat: add build.ps1
2023-07-25 14:41:00 +03:00
David Wertenteil
1a2dda700b Merge pull request #1291 from XDRAGON2002/issue_1290
fix: yamlhandler error handling
2023-07-25 14:39:26 +03:00
rcohencyberarmor
c4e5611c7f add print in the cli to which version the kubescape was update (#1295)
* add print in the cli to which version the kubescape was update

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* update will suggest to our user to update by following kubescape installation guide

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

---------

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Co-authored-by: rcohencyberarmor <rcohen@armosec.io>
2023-07-25 14:37:44 +03:00
DRAGON
d8e913fb9f feat: add build.ps1
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-07-25 14:36:57 +05:30
David Wertenteil
a37b1f7319 update armo docs
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-25 11:01:48 +03:00
rcohencyberarmor
b730ef5154 git recognition for empty directory for test
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
2023-07-24 17:24:13 +03:00
rcohencyberarmor
3280173e95 add error handle when there are no scan to trigger since the directory not contain any relevant scanning files
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
2023-07-24 17:17:06 +03:00
DRAGON
d0ae4f1c1a fix: yamlhandler error handling
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-07-22 13:26:40 +05:30
Vlad Klokun
e4faad8284 Merge pull request #1287 from XDRAGON2002/issue_1255
fix: --- kubescape fix
2023-07-21 21:19:04 +03:00
Vlad Klokun
bc131efd91 tests(fixhandler): remove tests of an unexported sanitization method
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-07-21 20:29:04 +03:00
Vlad Klokun
4763f0d69d docs(fixhandler): follow Go Doc comments convention in sanitization func
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-07-21 20:28:18 +03:00
Vlad Klokun
22c412ce7f refactor(fixhandler): sanitize YAML inside ApplyFixToContent
External observers don’t need to be aware of the fact we need to
sanitize leading document separators in YAML files. This should be
hidden inside our public function - `ApplyFixToContent()`.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-07-21 20:17:33 +03:00
Vlad Klokun
1503e984f8 tests(fixhandler): fail test if unable to open test data file
Previously when there was a typo in a test file name, we silently
failed. This commit makes the test explicitly fail if a test data file
was not found.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-07-21 19:55:03 +03:00
Vlad Klokun
a4478ba899 style(fixhandler): newlines and spacing
Ran with `go fmt`.

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-07-21 19:45:43 +03:00
David Wertenteil
fcbcb53995 Merge pull request #1276 from amirmalka/time-based-cached-policies
Time-based cached policies
2023-07-20 16:56:39 +03:00
YiscahLevySilas1
17c43fd366 support related objects (#1272)
* support related objects

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update pkg versions

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update go mod

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix test

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix test

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* only add ids of related resource

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fixes following review

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* add test for processRule

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-07-20 16:23:58 +03:00
YiscahLevySilas1
d44746cb85 allow adding a fw name when running all (#1286)
* allow adding a fw name when running all

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

clean code

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* fix following review

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-07-20 14:07:38 +03:00
DRAGON
912035662b fix: --- kubescape fix
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-07-20 00:05:23 +05:30
Matthias Bertschy
61dac76369 Merge pull request #1283 from kubescape/remove-website
Remove website folder
2023-07-19 16:29:34 +02:00
Amir Malka
bacf15eeb8 cache control inputs
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-07-18 15:56:16 +03:00
Craig Box
0a5af235e3 Remove website folder
Signed-off-by: Craig Box <craigb@armosec.io>
2023-07-17 20:09:34 +12:00
David Wertenteil
6fec02caff Merge pull request #1281 from XDRAGON2002/issue_1280
fix: stuck spinner
2023-07-17 09:27:26 +03:00
DRAGON
067655d003 fix: stuck spinner
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-07-14 01:24:46 +05:30
DRAGON
d55a74c6b2 fix: kubescape list controls
Signed-off-by: DRAGON <anantvijay3@gmail.com>
2023-07-11 21:08:24 +05:30
Amir Malka
e470fce6ed initial implementation of OpenTelemetry metrics collection (#1269)
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-07-10 14:22:26 +03:00
Amir Malka
ea3172eda6 time-based cached policies
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-07-10 10:54:56 +03:00
Nicolas Vuillamy
31c4badf1c Update installation.md to add instructions to install a previous version via SH 2023-07-09 21:22:47 +02:00
David Wertenteil
f060d02fbc Merge pull request #1267 from dwertent/submit-untracked-files
feat(file scanning): Submit untracked files
2023-07-06 09:40:21 +03:00
David Wertenteil
43975ddafe Merge pull request #1266 from batazor/patch-1
Update grafana-kubescape-dashboard.json
2023-07-06 09:40:06 +03:00
David Wertenteil
abe0477249 Merge pull request #1265 from dwertent/update-submit-message
Update submit message
2023-07-06 09:39:04 +03:00
David Wertenteil
5f197eb27c submit file scanning
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-06 09:25:34 +03:00
Victor Login
84b43d2b03 Update grafana-kubescape-dashboard.json
Signed-off-by: Victor Login <batazor@evrone.com>
2023-07-05 19:03:27 +02:00
David Wertenteil
b149e00d1a Merge pull request #1264 from dwertent/deprecate-image-controls
core(adaptors): Ignore adaptors when credentials are not set
2023-07-05 17:48:12 +03:00
David Wertenteil
f98b394ec2 Merge pull request #1254 from kubescape/rbac-fix
initialize ns in case we don't have one in YAML
2023-07-05 17:47:42 +03:00
David Wertenteil
492b08c995 Merge pull request #1259 from kubescape/update_regolibrary_version
Update regolibrary version
2023-07-05 17:46:35 +03:00
David Wertenteil
8fa15688fb Merge pull request #1260 from dwertent/deprecate-host-scanner
Deprecated host-scanner from CLI
2023-07-05 17:46:12 +03:00
David Wertenteil
1a3e140e56 Merge pull request #1261 from Oshratn/master
English language fix on Kubescape output
2023-07-05 12:59:19 +03:00
David Wertenteil
72f6988bb4 update messaging based on Oshrats comments
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-05 10:40:22 +03:00
David Wertenteil
780be45392 update submit message
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-05 10:38:59 +03:00
David Wertenteil
676771e8b3 deprecate the login flags
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-05 10:16:09 +03:00
David Wertenteil
06f5c24b7d ignore adaptors if credentials are not set
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-05 10:13:21 +03:00
David Wertenteil
c17415d6e9 deprecate host-scan-yaml flag
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-05 09:02:21 +03:00
David Wertenteil
b5bed7bfbb remove unused file
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-05 08:59:57 +03:00
Oshrat Nir
3c38021f7c Changed Assistance Remediation to Assited Remediation
Signed-off-by: Oshrat Nir <oshratn@gmail.com>
2023-07-04 13:13:50 +03:00
David Wertenteil
8989cc1679 Deprecated host-scanner
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-07-04 09:43:10 +03:00
kooomix
0ab9c32715 fxi test jsons 2023-07-02 13:29:28 +03:00
kooomix
868db91801 update regolibrary to v1.0.286-rc.0 2023-07-02 13:25:37 +03:00
Craig Box
aa0fe21a2e Merge pull request #1257 from dwertent/update-armo-landing-page
docs(Installation): update installation steps
2023-06-27 08:22:58 +01:00
David Wertenteil
1b181a47ef Update docs/providers/armo.md
Co-authored-by: Craig Box <craig.box@gmail.com>
2023-06-27 07:42:42 +03:00
David Wertenteil
30487dcd0e Update docs/providers/armo.md
Co-authored-by: Craig Box <craig.box@gmail.com>
2023-06-27 07:42:33 +03:00
David Wertenteil
46ad069fe5 Updating overview
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-06-26 13:54:00 +03:00
David Wertenteil
05d5de17d5 fixed wording
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-06-26 09:49:00 +03:00
David Wertenteil
6bc79458b0 Split the installation command from scanning
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-06-26 09:46:13 +03:00
David Wertenteil
ab85ca2b28 update installation steps
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-06-26 09:40:21 +03:00
Matthias Bertschy
99938ecbee initialize ns in case we don't have one in YAML
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-06-19 07:47:29 +02:00
Matthias Bertschy
e2f8e273ad Merge pull request #1252 from testwill/ioutil
chore: remove refs to deprecated io/ioutil
2023-06-15 08:00:05 +02:00
guoguangwu
be63e1ef7c chore: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-06-14 16:33:24 +08:00
guangwu
5e5b9d564c fix: CVE-2023-28840 CVE-2023-28841 CVE-2023-28842 CVE-2022-41723 etc. (#1221)
* fix: CVE-2023-28840 CVE-2023-28841 CVE-2023-28842 CVE-2022-41723GHSA-vvpx-j8f3-3w6h CVE-2022-23524 CVE-2022-23525 CVE-2022-23526 CVE-2022-36055 CVE-2023-25165

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>

* restore go.sum

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: David Wertenteil <dwertent@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-06-13 11:39:25 +03:00
YiscahLevySilas1
8ee72895b9 Fix statuses - Manual review and Requires configuration (#1251)
* fix statuses - req. review, configurations, manual

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update opa-utils version

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update opa-utils version

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update opa-utils version

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* use const for inner info

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-06-12 10:38:35 +03:00
Nitish Chauhan
6cefada215 correcting the formating of the table in pdf output (#1244)
* correcting the formatting of the table in pdf output

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* adding some starting unit tests

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* resolving the mod error

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

---------

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
2023-06-04 15:21:07 +03:00
David Wertenteil
211ee487b3 core(metrics api): Update API default behavior (#1250)
* scan default frameworks

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: update context

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* do not trigger host scan

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* adding unitests

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-06-04 15:12:31 +03:00
David Wertenteil
bbe46c9fab Merge pull request #1247 from kubescape/fix/remove-kubelet-command-line-endpoint
fix: remove deprecated endpoint
2023-05-31 17:17:09 +03:00
Alessio Greggi
ce7fde582c fix: update host-scanner version
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-05-31 14:14:29 +02:00
David Wertenteil
1c31e1f015 Merge pull request #1246 from dwertent/cli-updates
core(cmd): Minor CLI updates
2023-05-30 11:55:38 +03:00
Alessio Greggi
9e2fe607d8 fix: remove deprecated endpoint
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-05-30 10:50:31 +02:00
David Wertenteil
5a5ec9b641 wip: remove secretKey and clientID from list cmd
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-05-28 22:37:48 +03:00
David Wertenteil
24c608e204 wip: add example for exclude-namespaces flag
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-05-28 22:35:45 +03:00
David Wertenteil
ac43036b4a Merge pull request #1241 from kubescape/hostsensor-improvements
host-scanner improvements
2023-05-28 08:57:11 +03:00
David Wertenteil
03b89047f8 Merge pull request #1243 from anubhav06/update-go-git-url
update kubescape/go-git-url version
2023-05-28 08:46:22 +03:00
Anubhav Gupta
07a5c6488b update kubescape/go-git-url version
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2023-05-26 18:13:39 +05:30
Alessio Greggi
c486b4fed7 feat: add log coupling for hostsensorutils
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-05-24 14:46:34 +02:00
Alessio Greggi
00c48d756d fix(hostsensorutils): add finalizers deletion
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-05-24 11:49:15 +02:00
Alessio Greggi
b49563ae8c fix(hostsensorutils): reduce periods of readiness probe
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-05-24 11:34:04 +02:00
Alessio Greggi
7840ecb5da fix: move host-scanner to kubescape namespace
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-05-24 09:45:12 +02:00
David Wertenteil
e151c5bf81 Merge pull request #1240 from amirmalka/memory-optimizations
bump opa-utils version for memory optimizations
2023-05-23 20:37:27 +03:00
Amir Malka
225545476c update opa-utils
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-05-23 19:18:45 +03:00
Amir Malka
987f97102d bump opa-utils version for memory optimizations
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-05-22 16:44:11 +03:00
Craig Box
7bffed2afe Merge pull request #1239 from yrs147/master 2023-05-18 16:39:25 +03:00
Hollow Man
3357713903 Add back new line at the end of the file
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-18 13:38:35 +03:00
Yash Raj Singh
efd48eab08 Removed instructions and added the wiki link
Co-authored-by: Hollow Man <hollowman@opensuse.org>

Signed-off-by: Yash Raj Singh <98258627+yrs147@users.noreply.github.com>
2023-05-18 13:38:27 +03:00
Yash Raj
231d9c231a Added instructions to setup kubescape locally
Signed-off-by: Yash Raj <yashraj14700728@gmail.com>
2023-05-18 13:34:13 +05:30
Craig Box
91e705a3eb Merge pull request #1238 from HollowMan6/macm1 2023-05-17 16:37:13 +03:00
Songlin Jiang
a92d573cb8 Fix downloading arm64 binary for kubescape
Signed-off-by: Songlin Jiang <songlin.jiang@csc.fi>
2023-05-17 15:34:32 +03:00
David Wertenteil
e8c72b9883 Merge pull request #1235 from kubescape/revert-1213-windows-latest
Revert "Deprecate kubescape-windows-latest"
2023-05-16 10:07:39 +03:00
David Wertenteil
d380b2cb00 Revert "Deprecate kubescape-windows-latest" 2023-05-16 10:03:41 +03:00
Yuval Leibovich
50b3d0f313 Merge pull request #1233 from kubescape/update-compliance-score-with-readme
updating readme file to support compliance
2023-05-15 17:31:40 +03:00
David Wertenteil
474b6d07ed Merge pull request #1234 from kubescape/timeout
start with a new context, extracting span from request
2023-05-15 16:47:25 +03:00
Matthias Bertschy
2cddc4b395 start with a new context, extracting span from request
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-05-15 14:55:46 +02:00
Yuval Leibovich
b5fb355a22 updating readme file to support compliance 2023-05-15 15:31:14 +03:00
David Wertenteil
d1bc6d0190 Merge pull request #1213 from HollowMan6/windows-latest
Deprecate kubescape-windows-latest
2023-05-15 13:23:32 +03:00
Amir Malka
0a0ef10d50 Control parallelism of opa rule processing by env var (#1230)
* control parallelism of opa rule processing by env var

Signed-off-by: Amir Malka <amirm@armosec.io>

* go 1.20

Signed-off-by: Amir Malka <amirm@armosec.io>

* update go.mod go.sum

Signed-off-by: Amir Malka <amirm@armosec.io>

---------

Signed-off-by: Amir Malka <amirm@armosec.io>
2023-05-14 14:59:21 +03:00
David Wertenteil
4523dc8456 Merge pull request #1232 from amirmalka/update-golang-version
Update go version 1.19->1.20
2023-05-14 11:18:18 +03:00
Amir Malka
b26f83d0bd update go version 1.19->1.20
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-05-14 10:04:30 +03:00
David Wertenteil
9cc3053d74 Merge pull request #1214 from HollowMan6/dispatch
Add ref to workflow dispatch
2023-05-11 15:13:24 +01:00
Yuval Leibovich
84842a6a91 Merge pull request #1219 from kubescape/add-system-test
add compliance score system test
2023-05-08 10:26:00 +03:00
YiscahLevySilas1
aff8cc480e add compliance score system test
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-05-07 16:07:39 +03:00
David Wertenteil
7feea43421 Merge pull request #1216 from HollowMan6/install
Make powershell Windows installation user path available immediately
2023-05-03 10:58:47 +03:00
David Wertenteil
04ec32c9f4 Merge pull request #1218 from dwertent/hot-fix-2.3.0
fix(adaptors) Check response size
2023-05-03 10:05:17 +03:00
David Wertenteil
b805f22038 add test
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-05-03 08:58:12 +03:00
David Wertenteil
092f37a636 if the response is empty, return an empty string
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-05-03 08:39:59 +03:00
Hollow Man
9a2eb46f65 Make powershell Windows installation user path available immediately
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-02 00:23:01 +03:00
Hollow Man
c637c1a589 Add ref to workflow dispatch
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-01 22:07:50 +03:00
David Wertenteil
7609a4aa5d Merge pull request #1199 from HollowMan6/install
Update installation script
2023-05-01 21:53:16 +03:00
Hollow Man
75d31c22d9 Deprecate kubescape-windows-latest
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-01 17:38:46 +03:00
David Wertenteil
b93a97a8c8 Merge pull request #1186 from HollowMan6/dispatch
Invoke packaging workflow to update after release
2023-05-01 16:45:10 +03:00
David Wertenteil
88696ca233 Merge pull request #1169 from HollowMan6/exe
Add kubescape.exe to the release assets
2023-05-01 16:40:04 +03:00
David Wertenteil
87d94d16ff Merge pull request #1212 from kubescape/token
change basic auth username to x-token-auth
2023-05-01 14:56:36 +03:00
Hollow Man
1843bcdaf8 invoke only if the repository owner is kubescape
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-01 13:46:39 +03:00
Hollow Man
cdaff7ddbe Revert install.ps1 change, to update after release
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-01 13:24:40 +03:00
Hollow Man
ec7bc26f64 Add kubescape.exe to the release assets
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-05-01 13:24:35 +03:00
Matthias Bertschy
75b64d58f3 change basic auth username to x-token-auth
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-05-01 10:55:07 +02:00
David Wertenteil
dce1d762c6 Merge pull request #1209 from kubescape/new-threshold-flag
Add compliance score to controls
2023-05-01 11:23:20 +03:00
YiscahLevySilas1
f3225855d0 rerun workflows
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-05-01 09:19:09 +03:00
David Wertenteil
5ae421dbc2 Merge pull request #1210 from HollowMan6/master
ci: update before install packages
2023-04-30 15:09:55 +03:00
Hollow Man
d4b75dcb0c ci: update before install packages
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-27 15:50:21 +00:00
YiscahLevySilas1
b7935276e3 Merge branch 'master' of github.com:kubescape/kubescape into new-threshold-flag
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-27 15:56:12 +03:00
YiscahLevySilas1
d6edd818b8 add compliance score to new field in controls for backward compatibility
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-27 15:53:47 +03:00
David Wertenteil
a73081c816 Merge pull request #1203 from kubescape/fix/remove-outdated-endpoints
fix: remove outdated enpoints
2023-04-27 11:23:18 +03:00
David Wertenteil
dd961b9e55 Merge pull request #1208 from kubescape/fix/hostsensor-http-probe-attributes
fix(hostsensorutils): fix indentation of probe attributes
2023-04-27 11:22:50 +03:00
Alessio Greggi
76ced13a26 fix(hostsensorutils): fix indentation of probe attributes
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-04-26 16:16:29 +02:00
YiscahLevySilas1
95e88f8581 add compliance-threshold, deprecate fail-threshold (#1197)
* add compliance-threshold, deprecate fail-threshold

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update opa-utils version

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

* update opa-utils version for fix in compliance score

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>

---------

Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-24 15:33:30 +03:00
David Wertenteil
5955247f01 Merge pull request #1207 from dwertent/fix-workflow
fix(workflow): Fix workflow
2023-04-23 13:26:48 +03:00
David Wertenteil
c0530b4f88 wip: fixed github actions
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-04-23 11:47:54 +03:00
David Wertenteil
c23d6a17cc wip: update fix command example
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-04-23 11:45:46 +03:00
David Wertenteil
d448de131f Merge pull request #1148 from HollowMan6/master
arm64 release binaries for CI and Krew
2023-04-23 09:48:05 +03:00
Alessio Greggi
b48c04da63 fix: remove outdated enpoints
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-04-21 19:47:24 +02:00
David Wertenteil
ecf770c756 Merge pull request #1189 from dwertent/hotfix-2.2.6-add_data
fix(submit): set default report time
2023-04-20 16:39:51 +03:00
Hollow Man
6e33f37aee Update installation script
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-20 13:05:51 +03:00
Hollow Man
03f792e968 Revert change to install.sh
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-20 11:21:34 +03:00
David Wertenteil
b017d77b86 Merge pull request #1184 from HollowMan6/sarif-fix
feat(sarif): add fix object in generated reports
2023-04-20 11:15:49 +03:00
Craig Box
2cde591180 Merge pull request #1196 from HollowMan6/doc
Move building instructions to wiki, add more installation instructions
2023-04-20 14:55:52 +12:00
YiscahLevySilas1
f25d573f32 update opa-utils version for fix in compliance score
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-19 18:34:10 +03:00
Hollow Man
ebf3e49f53 Update snap installation
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-18 02:02:43 +03:00
YiscahLevySilas1
acaf6e78da update opa-utils version
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-17 20:25:27 +03:00
YiscahLevySilas1
344e9188f6 add compliance-threshold, deprecate fail-threshold
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-17 16:08:38 +03:00
Hollow Man
3f69f06df1 Move Building to wiki and installation back to docs
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-17 14:10:47 +03:00
Hollow Man
e0b296c124 Move installation instructions to wiki
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-16 19:35:11 +03:00
David Wertenteil
108bbd8bc4 Merge pull request #1193 from suhasgumma/master
Fix: Empty Frameworks Column when listing controls
2023-04-16 09:13:38 +03:00
Hollow Man
5c1a41e920 nit
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-13 10:54:25 +03:00
Hollow Man
0b8d207615 Add more error check
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-13 10:54:25 +03:00
Hollow Man
539b6c51b9 Add unit testcase
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-13 10:54:25 +03:00
Hollow Man
19ca590e2f S1023: redundant break statement (gosimple)
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-13 10:54:25 +03:00
Hollow Man
4de50f82c0 feat(sarif): add fix object in generated reports
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-13 10:54:19 +03:00
Hollow Man
ab41d5dbf4 Invoke workflow to update github action
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-12 22:33:02 +03:00
Matthias Bertschy
fa6de6dc3f Merge pull request #1192 from Sindhuinti/Sindhuinti/broken-link
fix: broken link
2023-04-11 14:14:27 +02:00
Suhas Gumma
96e959c3b7 Fix: Empty Frameworks Column when listing controls
Signed-off-by: Suhas Gumma <suhasgumma2001@gmail.com>
2023-04-11 15:20:07 +05:30
Sindhu Inti
28fdee0dd2 fix: broken link
Signed-off-by: Sindhuinti <iamsindhuinti23@gmail.com>
2023-04-11 13:10:31 +05:30
Sindhu Inti
9ce25c45fe fix: broken link 2023-04-11 13:01:49 +05:30
MathoAvito
d44b9f7a31 Change wf (#1190)
* added coveralls coverage tests 

Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-04-09 18:29:23 +03:00
David Wertenteil
c7af6266fd Merge pull request #1185 from HollowMan6/fix-changes
fix(fix): mixed up change summary list
2023-04-09 11:19:44 +02:00
David Wertenteil
91c13381b2 set default report time
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-04-09 11:15:06 +02:00
Hollow Man
30ad3adbb6 Invoke workflow to update after release
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 15:49:25 +03:00
Hollow Man
64e3b08641 fix(fix): mixed up change list
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 01:07:49 +03:00
Hollow Man
6d7a89bb74 Add ARM64 binary installation
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
e8d92ffd43 Resume test core pkg under ubuntu arm64
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
48a15e1a8d Disable multi-platform test with commits
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
d02f15ef6f merge pr scanner build into binary-build-and-e2e-tests
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
9327f70e1a Fix naming
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
c498026208 Disable core pkg test for ubuntu arm64
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
3238555df3 add cross compilation for ubuntu arm64
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
Hollow Man
0c77d89bfc add cross compilation for mac m1
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-04-07 00:47:40 +03:00
yuleib
875deb7ec3 adding compliance score updates (#1181)
Signed-off-by: Yuval Leibovich <yuvall@armosec.io>
2023-04-04 16:03:40 +03:00
David Wertenteil
eae234136b Merge pull request #1178 from YiscahLevySilas1/update-k8s-interface
update version k8s-interface for cloud resources
2023-04-03 13:54:02 +03:00
YiscahLevySilas1
93a35fffbd comment failing test because of many requests
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-03 10:45:51 +03:00
David Wertenteil
fc97b0ad19 Merge pull request #1179 from kubescape/change_wf
delete BUILD_AND_TEST_LOCAL_KUBESCAPE_CLI input for b-binary-build-an…
2023-04-03 10:26:56 +03:00
YiscahLevySilas1
9a3767ef72 update version k8s-interface for cloud resources
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-03 09:53:22 +03:00
Matan Shkalim
173eac552c delete BUILD_AND_TEST_LOCAL_KUBESCAPE_CLI input for b-binary-build-and-e2e-tests wf
Signed-off-by: Matan Shkalim <shekel8@gmail.com>
2023-04-03 07:40:09 +01:00
YiscahLevySilas1
9420fd5e79 update version k8s-interface for cloud resources
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-04-03 09:34:22 +03:00
Matthias Bertschy
eeda903c76 Merge pull request #1177 from kubescape/update-meeting
Add new meeting location
2023-04-03 07:27:08 +02:00
Craig Box
fd17a87788 Add new meeting location
Changed Zoom URL and added timezone calculator.

Signed-off-by: Craig Box <craigb@armosec.io>
2023-04-03 16:45:26 +12:00
David Wertenteil
1de14ce1e3 Merge pull request #1171 from kubescape/feat/add-progress-bar-during-cloud-resources-download
feat: add progress bar during cloud resources download
2023-04-02 13:53:44 +03:00
David Wertenteil
143d1bb601 Merge pull request #1161 from kubescape/change_wf
change trigger for wf
2023-04-02 13:51:54 +03:00
Alessio Greggi
feb39ed130 test: fix test with new function argument
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-03-28 16:39:00 +02:00
David Wertenteil
83363d68e6 Merge pull request #1170 from dwertent/fix-get-account-id
fix(config): Load account details
2023-03-28 17:19:56 +03:00
Alessio Greggi
f010364c98 feat: add progress bar during cloud resources download
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-03-28 16:10:55 +02:00
David Wertenteil
64b8f48469 clean code
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-28 16:54:02 +03:00
David Wertenteil
de8d365919 load account details
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-28 16:03:31 +03:00
David Wertenteil
db2259d3d0 Merge pull request #1167 from dwertent/update-host-scanner-tag
core(host-scanner): Update host scanner image tag
2023-03-26 22:59:12 +03:00
David Wertenteil
7b9ad26e8e update host scanner image tag
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-26 15:07:06 +03:00
Amir Malka
e35029934b updated createTenant path (#1166)
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-03-26 13:21:30 +03:00
Matthias Bertschy
181ebc27e1 Merge pull request #1154 from fredbi/refact/refacf-host-sensor-exports
refact(hostsensorutils): refactors host sensor exports
2023-03-25 09:56:33 +01:00
Frédéric BIDON
a090a296fa refact(hostsensorutils): unexported fields that don't need to be exposed
Also:
* declared scanner resources as an enum type
* replaced stdlib json, added uit tests for skipped resources
* unexported worker pool
* more unexported methods (i.e. everything that is not part of the interface)
* refact(core): clarified mock injection logic and added a few unit tests at the caller's (CLI init utils)

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-03-25 09:37:24 +01:00
Matthias Bertschy
1e1a48bd9a Merge pull request #1064 from fredbi/perf/opaprocessor-process
perf(opaprocessor): run OPA rule compilation and evaluation in parallel
2023-03-24 15:38:14 +01:00
Matthias Bertschy
5923ce5703 Merge pull request #1147 from HollowMan6/install
Change installation path to ~/.kubescape/bin
2023-03-24 12:46:13 +01:00
Hollow Man
d2dcd29089 fix shellcheck warning and info
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-24 13:39:15 +02:00
Matthias Bertschy
8a40bab43a Merge pull request #1165 from fredbi/refact/test-utils
Refact(test utils): introduce internal/testutils
2023-03-24 12:38:14 +01:00
Frederic BIDON
dee3a10bac test(utils): introduced internal/testutils package to factorize testing utilities
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

Conflicts:
	core/pkg/hostsensorutils/hostsensordeploy_test.go
2023-03-24 11:15:25 +01:00
Matthias Bertschy
9e3ac4b0f7 Merge pull request #1118 from fredbi/chore/refact-kscloud-client
refact(getter): refactor the KS Cloud client
2023-03-24 11:01:31 +01:00
Matthias Bertschy
58f29523a8 Merge pull request #1141 from fredbi/refact/factorize-hostsensor-api-calls
refact(hostsensorutils): refactors the host sensor
2023-03-24 10:52:52 +01:00
Frédéric BIDON
5b62b0b749 addressed review from David: reverted on unconditional loop exit
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2023-03-23 16:56:37 +01:00
Frédéric BIDON
e4f34f6173 refact(host-sensor): refactors the host sensor
This PR factorizes the list of calls to the host-scanner API in a loop.

More godoc-friendly doc strings are added.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2023-03-23 16:56:37 +01:00
Frédéric BIDON
4a9f26b27c perf(opaprocessor): run OPA rule compilation and evaluation in parallel
This parallelize the Process() portion of the OPA processor.

The main change is that called methods to evaluate a rule no longer
mutate the internal state of the opaprocessor and allocate maps (less
often, in larger chunks) that are merged at the end of the processing.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2023-03-23 16:56:21 +01:00
Frederic BIDON
548955fc16 refact(getter): refactor the KS Cloud client
* Interfaces are unchanged

* Deprecated: low-level API funcs marked for deprecation:
  HttpPost, HttpGetter, HttpDelete (an augmented version of the KS Cloud
  client will expose the post report API, which is currently the sole
  use-case of low-level API)

* Doc: the package is now godoc-friendly

* Style & code layout:
  * listed all exposed types via aliases, for clarity/less confusing
    imports
  * unexported private types
  * factorized query param logic
  * factorized type <-> JSON using generic func & io.Reader
  * "utils" are now limited to a few common utility functions
  * centralized hard-coded strings as (unexported) constants
  * concision: use higher-level http definitions such as constants,
    cookie methods, etc
  * included type-safety guards to verify that interfaces are
    actually implemented by the exported types

* Tests: existing test assertions are unchanged
  * tests are beefed-up to assert proper authentication flow (token & cookie).
  * added unit tests for utility methods

* Perf:
  * unmarshalling API responses is now flowing without extraneous memory allocation via string representation
  * request headers are now passed withot extraneous map allocation
  * JSON operations are now fully supported by jsoniter (no longer use encoding/json)

* Changes in functionality:
  * the client is now fully extensible with KSCloudOption
  * use the option functor idiom to keep constructors short
  * methods that used to mute errors (i.e. return nil, nil) now bubble up errors
  * the captured cookie is now captured in full, not just its value
  (other cookie parameters returned are stored)
  * added a request/response dump option, for debugging
  * added support for SubmitReport and retrieval of UI url's
  * backported utm changes (reports use case)

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-03-23 16:47:23 +01:00
David Wertenteil
ac2bc6c950 Merge to master - PR number: 1164 2023-03-23 12:49:52 +02:00
MathoAvito
ea27c619d4 Revert "added validation for if ORIGIN_TAG=null" 2023-03-23 12:47:42 +02:00
matanshk
e4150b2bb4 Merge pull request #1163 from kubescape/change-wf
added validation for if ORIGIN_TAG=null
2023-03-23 11:17:06 +02:00
Matan Avital
86c7215a72 added validation for if ORIGIN_TAG=null
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-23 11:16:03 +02:00
Hollow Man
5c24267ee9 check KUBESCAPE_EXEC is not empty before deletion
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-21 13:15:21 +02:00
Matan Shkalim
bb576610ff change concurrency in 00-pr-scanner
Signed-off-by: Matan Shkalim <shekel8@gmail.com>
2023-03-21 08:05:40 +00:00
Matan Shkalim
085be86197 remove merge action
Signed-off-by: Matan Shkalim <shekel8@gmail.com>
2023-03-21 08:01:59 +00:00
David Wertenteil
b4180b34e7 core(logs): Enhance logs (#1158)
* adding ks version

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Initialize scanInfo

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* print if logger level is lower than warning

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: scan default frameworks when scanning files

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* change print to log

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: Add end-line after last log

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* wip: silent spinner when logger is warn

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-20 17:49:51 +02:00
Matan Shkalim
6a750671c3 change trigger for wf
Signed-off-by: Matan Shkalim <shekel8@gmail.com>
2023-03-20 15:40:52 +00:00
David Wertenteil
bb5fedc661 Merge to master - PR number: 1160 2023-03-20 17:36:17 +02:00
Matan Avital
678ef2b787 changed ks_branch to release
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-20 17:34:48 +02:00
David Wertenteil
8c238232a1 Merge to master - PR number: 1159 2023-03-20 17:25:56 +02:00
Matan Avital
2ea9e1a596 moved the output TEST_NAMES to wf-preparation job (was check-secret job) and added step export_tests..
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-20 17:22:52 +02:00
matanshk
e788d68f2c Merge pull request #1157 from kubescape/change-wf
Change wf
2023-03-20 14:12:28 +02:00
Matan Avital
62e3d3263d fixed syntax error
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-20 14:11:09 +02:00
Matan Avital
650d489c26 fixed syntax error
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-20 14:09:04 +02:00
matanshk
ea4914057e Merge pull request #1156 from kubescape/change-wf
added input to make the binary build and test dynamic
2023-03-20 13:49:50 +02:00
Matan Avital
100822f48d added input to make the binary build and test dynamic
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-20 13:45:31 +02:00
matanshk
a5f254bebd Merge pull request #1155 from kubescape/change-wf
added CHECKOUT_REPO input parameter
2023-03-19 18:22:12 +02:00
Matan Avital
e3d5a8c3c6 added CHECKOUT_REPO input parameter
Signed-off-by: Matan Avital <matavital13@gmail.com>
2023-03-19 18:19:48 +02:00
Matthias Bertschy
63ff0f5dc9 Merge pull request #1151 from docwhat/patch-1
fix references to kubectl in completion help
2023-03-18 21:55:38 +01:00
David Wertenteil
5173016a1e Merge pull request #1152 from dwertent/update-otel-events
fix(otel): Update otel events
2023-03-16 14:09:58 +02:00
David Wertenteil
4a95e29d5d Merge to master - PR number: 1150 2023-03-16 10:28:44 +02:00
David Wertenteil
d0b5c7c2c2 update host scanner image tag
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-16 09:45:12 +02:00
David Wertenteil
6671ac46f4 change failed to submit message
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-16 09:42:39 +02:00
David Wertenteil
28531859f3 Signed-off-by: David Wertenteil <dwertent@armosec.io>
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-15 21:26:10 +02:00
Christian Höltje
4ee209c1ea fix references to kubectl in completion help
Signed-off-by: Christian Höltje <docwhat@gerf.org>
2023-03-15 14:30:38 -04:00
David Wertenteil
4edeec146a Set scanning event
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-15 18:34:02 +02:00
David Wertenteil
ec4a098b1c replace error by warning
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-15 17:17:29 +02:00
David Wertenteil
a29fe367dc Added context to HandleResults
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-15 16:58:02 +02:00
Avraham Shalev
aceb4eb0de add dependencies to httphandler
Signed-off-by: Avraham Shalev <8184528+avrahams@users.noreply.github.com>
2023-03-15 14:49:47 +02:00
David Wertenteil
e7afe45706 Merge to master - PR number: 1149 2023-03-15 14:26:56 +02:00
Avraham Shalev
55ce7086d7 upgrade opa-utils and armo api
Signed-off-by: Avraham Shalev <8184528+avrahams@users.noreply.github.com>
2023-03-15 13:53:30 +02:00
Hollow Man
bb04e98d69 Add prompt for removing old way of installation
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-15 00:04:21 +02:00
Hollow Man
0ae4ef2244 Clean uninstall of old installation
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-14 22:23:29 +02:00
Hollow Man
f9e38fd6a2 Change installation path to ~/.kubescape/bin
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-14 21:16:25 +02:00
Amir Malka
106db84a66 bump go-logger (#1144)
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-03-14 10:00:08 +02:00
David Wertenteil
1930004e60 Merge to master - PR number: 1146 2023-03-14 08:17:49 +02:00
Craig Box
015476bf97 Update CONTRIBUTING.md
Fix the link to correcting the DCO.

Signed-off-by: Craig Box <craigb@armosec.io>
2023-03-14 16:33:26 +13:00
David Wertenteil
1e0b9563a1 Merge to master - PR number: 1129 2023-03-13 13:43:07 +02:00
Alessio Greggi
5aa56b1c0a feat: integrate support to retrieve eks policies
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-03-13 11:35:07 +01:00
David Wertenteil
fd92411593 Merge pull request #1140 from HollowMan6/master
ci(release): fix publishing krew plugin; add '.exe' extension to Windows binary
2023-03-13 10:42:54 +02:00
David Wertenteil
cb97a424fd Merge pull request #1139 from matthyx/fixcontext
initialize context in Prometheus handler
2023-03-12 16:37:50 +02:00
Hollow Man
2542692f25 Revert add '.exe' to Win release binary
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-12 11:58:43 +02:00
Hollow Man
640483e991 ci(release): fix publishing krew plugin; add .exe suffix to Win binary
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-03-12 00:39:34 +02:00
Matthias Bertschy
1004902f51 initialize context in Prometheus handler
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-03-09 14:05:26 +01:00
Matthias Bertschy
3b9ce494f5 Merge pull request #1131 from fredbi/test/more-tests-report-receiver
test(reports): adds unit test to the report receiver
2023-03-08 16:56:51 +01:00
Matthias Bertschy
5a37045d9b Merge pull request #1138 from fredbi/test/unit-tests-hostsensorutils
test(hostsensorutils): added unit tests to the hostsensorutils package
2023-03-08 11:12:26 +01:00
Frederic BIDON
91af277a1c fixup unit test: error handling
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-03-08 08:53:28 +01:00
Frederic BIDON
556962a7e1 test(hostsensorutils): added unit tests to the hostsensorutils package
This PR introduces a (limited) mock for the kubernetes client API.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-03-07 20:35:29 +01:00
Frederic BIDON
306da021db test(reports): adds unit test to the report receiver
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>

replace mock

Signed-off-by: Daniel-GrunbergerCA@armosec.com
2023-03-07 19:59:31 +01:00
David Wertenteil
03b0147e39 Merge pull request #1130 from dwertent/update-utm-link-v2
docs(links): Update URLs
2023-03-06 14:08:25 +02:00
Matthias Bertschy
ff9652bd77 Merge pull request #1136 from fredbi/chore/linting-again
chore(linting): run another pass of linting with the rules already in place
2023-03-05 21:17:45 +01:00
Frederic BIDON
7174f49f87 chore(lintin): run another pass of linting with the rules already in place
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-03-05 20:16:37 +01:00
David Wertenteil
7dfbbe7e39 Merge pull request #1133 from amirmalka/remove-otel-middleware-from-some-endpoints
Removed otel middleware from some APIs
2023-03-05 14:26:40 +02:00
Amir Malka
b3079df8ae removed otel middleware from some APIs
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-03-05 11:49:00 +02:00
David Wertenteil
0698c99241 wip: update UTMs & display UTM only on first scan
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-04 23:05:38 +02:00
David Wertenteil
2cda4864e7 wip: do not add message when account ID is empty
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-04 23:05:02 +02:00
David Wertenteil
c2b0e5c0a2 Do not display URL when message is empty
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-04 23:04:26 +02:00
David Wertenteil
6c54aff451 wip: removed unused code
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-04 22:46:20 +02:00
David Wertenteil
dea5649e01 wip: update link in docs
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-03-04 22:34:08 +02:00
Matthias Bertschy
9e6c9e0f65 Merge pull request #1127 from irLinja/master
refactor: update node scanner daemonset tolerations
2023-03-03 11:49:25 +01:00
Arash Haghighat
3dfd758a82 refactor: update node scanner daemonset tolerations
Signed-off-by: Arash Haghighat <arash@linja.pro>
2023-03-01 16:36:08 +01:00
David Wertenteil
0526f58657 Merge to master - PR number: 1121 2023-02-28 07:40:20 +02:00
Alessio Greggi
e419af6c03 ci: pin workflows versions to fixed commits
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-27 21:43:09 +01:00
Matthias Bertschy
03766ec0cd Merge pull request #1120 from alegrey91/fix/remove-hostnetwork-and-hostport-from-host-scanner-deployment
fix(hostsensorsutils): remove hostNetwork and hostPort from deployment
2023-02-27 19:12:05 +01:00
Alessio Greggi
39e2e34fc0 fix(hostsensorsutils): remove hostNet and hostPort from deployment
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-27 18:20:55 +01:00
David Wertenteil
245331b82a Merge pull request #1119 from amirmalka/added-cluster-name-to-otel-init
added clusterName to otel initialization
2023-02-26 19:27:14 +02:00
Amir Malka
cec4e5ca39 added clusterName to otel initialization
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-02-26 18:07:38 +02:00
David Wertenteil
b772588e96 Merge pull request #1117 from dwertent/v2.2.1-patches
V2.2.1 patches
2023-02-26 16:25:13 +02:00
David Wertenteil
5d6ac80c38 Move GITHUB_REF to the krew step
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-26 14:47:25 +02:00
David Wertenteil
33df0e5462 add unitsests to new behavior
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-24 09:49:32 +02:00
David Wertenteil
26ab049622 Do not print table when logger level is warn
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-24 09:19:43 +02:00
David Wertenteil
ac2aa764a4 marking structs that are implementing IPrinter
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-24 09:18:54 +02:00
David Wertenteil
d02bef62d3 wip: re-arange struct
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-24 09:17:31 +02:00
David Wertenteil
46682dfe16 Override GITHUB_REF env when releasing krew
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-24 00:34:18 +02:00
David Wertenteil
01c65194a8 removing host scanner otel env
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-24 00:13:22 +02:00
David Wertenteil
25e42ee4b6 Update rbac-utils pkg
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-23 23:33:35 +02:00
David Wertenteil
7e5abbdd73 Merge pull request #1054 from fredbi/fix/1051-gc-pressure
fix(processorhandler): reduce GC pressure
2023-02-23 23:15:22 +02:00
David Wertenteil
56183ba369 Merge to master - PR number: 1115 2023-02-23 17:32:48 +02:00
David Wertenteil
a9c1ecd3b8 Merge pull request #1104 from alegrey91/fix/improve-namespace-removing-in-host-sensor-lifecycle
fix(hostsensorutils): improve namespace deletion in host-scanner lifecycle
2023-02-23 16:54:09 +02:00
Alessio Greggi
d900ce6146 fix(hostsensorutils): improve namespace deletion in host-scanner lifecycle
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-23 14:41:57 +01:00
David Wertenteil
3a80ff00b6 update opa pkg to 238
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-23 14:25:21 +02:00
David Wertenteil
b989c4c21f update opa pkg
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-23 09:48:52 +02:00
Frédéric BIDON
65c26e22cf fix(processorhandler): reduce GC pressure
* this onboards an optimization from the opa-utils package (caching
exceptions processing)

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-02-22 20:53:02 +01:00
David Wertenteil
915fa919b2 Fix HTML output (#1111)
* Fixed HTML template

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Adding HTML output format example

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-21 13:55:12 +02:00
Matthias Bertschy
8102dd93ba bump go-git-url (#1110)
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-02-21 11:42:59 +02:00
David Wertenteil
35cafa9eb4 Merge pull request #1113 from amirmalka/fix-macos-build
Fix macos build - add missing pkg-config
2023-02-21 10:19:06 +02:00
Amir Malka
cc823d7559 fix macos build - add missing pkg-config
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-02-21 10:13:08 +02:00
David Wertenteil
eaa74487c2 Merge pull request #1103 from matthyx/enable-krew
enable krew plugin publishing action
2023-02-20 17:55:44 +02:00
David Wertenteil
e8a4c2033f Merge pull request #1084 from fredbi/test/download-release-policy
test(getter): more unit tests
2023-02-20 17:55:08 +02:00
Rotem Refael
8fd9258efa Merge pull request #1101 from alegrey91/fix/improve-cloud-provider-detection 2023-02-16 15:25:38 +02:00
Alessio Greggi
159d3907b5 style(hostsensorutils): simplify code with gofmt
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-16 11:38:55 +01:00
Matthias Bertschy
cde916bec8 Merge pull request #1095 from HollowMan6/master
fix(build): LICENSE file in release tarballs
2023-02-15 15:48:25 +01:00
Matthias Bertschy
8d289bd924 Merge pull request #1105 from HollowMan6/readme
fix(README): broken links
2023-02-15 13:33:59 +01:00
Hollow Man
fda1c83d01 fix(build): LICENSE file
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-02-15 14:21:42 +02:00
Hollow Man
31b6a3c571 fix(README): broken links
Signed-off-by: Hollow Man <hollowman@opensuse.org>
2023-02-15 14:15:38 +02:00
Matthias Bertschy
31a693e9b6 enable krew plugin publishing action
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-02-15 08:02:24 +01:00
Matthias Bertschy
5de228ce0f Merge pull request #1102 from johnmanjiro13/remove-ds-store
chore: Remove an unwanted file
2023-02-15 07:14:02 +01:00
johnmanjiro13
ed27641f04 chore: Remove an unwanted file
Signed-off-by: johnmanjiro13 <28798279+johnmanjiro13@users.noreply.github.com>
2023-02-15 00:07:12 +09:00
Amir Malka
df39e10300 Statuses (#1016) (#1082)
New statuses
2023-02-14 15:00:21 +02:00
Alessio Greggi
c7d1292c7d fix(hostsensorutils): improve cloud provider detection
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-14 13:46:09 +01:00
Matthias Bertschy
a52f13b8c9 Merge pull request #1100 from matthyx/krew-fix
modify plugin description for krew approval
2023-02-14 10:23:00 +01:00
Matthias Bertschy
16e34002f5 modify plugin description for krew approval
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-02-14 08:47:43 +01:00
Rotem Refael
3242de8a28 Merge pull request #1099 from kubescape/revert-1098-fix/controlplaneinfo-issue
Revert "fix: add check to skip controlplaneinfo in case of cloud providers"
2023-02-14 09:02:02 +02:00
yuleib
ca2730cd85 Revert "fix: add check to skip controlplaneinfo in case of cloud providers" 2023-02-14 08:59:03 +02:00
Rotem Refael
88b55cd6c3 Merge pull request #1098 from alegrey91/fix/controlplaneinfo-issue
fix: add check to skip controlplaneinfo in case of cloud providers
2023-02-14 08:56:35 +02:00
Alessio Greggi
46ca5036c4 fix: add check to skip controlplaneinfo in case of cloud providers
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-13 17:16:53 +01:00
Frederic BIDON
d8f1a25ab7 generated rego policy json fixture file, short-circuited call to github when fixture is here
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-02-10 17:29:46 +01:00
Frederic BIDON
56cfb4fcef test(getters): added unit tests for utilities
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-02-10 17:29:46 +01:00
Frederic BIDON
894d436274 test(getters): added unit tests to the kubescape API client
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-02-10 17:29:45 +01:00
Frederic BIDON
39166d40bf tests(cautils): added unit tests for released policy
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-02-10 17:29:45 +01:00
David Wertenteil
2ba3f78bfc Merge pull request #1094 from alegrey91/master
docs(contributing): add semantic commit messages best practice
2023-02-09 16:09:36 +02:00
Alessio Greggi
1d68d1ba67 docs(contributing): add semantic commit messages best practice
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2023-02-09 11:37:24 +01:00
David Wertenteil
6cc5116999 Loading kubeconfig name from env when running ms (#1089)
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-09 09:32:13 +02:00
David Wertenteil
7706c1264c removed unwnated span (#1088)
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-08 18:47:01 +02:00
Craig Box
2f299b6201 fix #1025 (#1087)
Signed-off-by: Craig Box <craigb@armosec.io>
2023-02-08 13:20:59 +02:00
David Wertenteil
f1af9d5687 Merge to master - PR number: 1086 2023-02-08 09:44:10 +02:00
David Wertenteil
d3abd66aa3 Default frameworks (#1085)
* Update default frameworks names

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Remove error loggers, print debug instead.

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-08 08:59:10 +02:00
YiscahLevySilas1
2a0a2cf95a update logs in some resource getters (#1071)
* change warning to debug

Signed-off-by: yiscah <yiscahls@armosec.io>

* update log

Signed-off-by: yiscah <yiscahls@armosec.io>

---------

Signed-off-by: yiscah <yiscahls@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-02-07 22:37:13 +02:00
YiscahLevySilas1
e90f08968f don't add host scanner as excluded ns, use exception instead (#1083)
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-02-07 22:36:32 +02:00
Matthias Bertschy
e6b7086961 Fixes for krew plugin submission (#1081)
* use tar.gz file for krew plugin

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

* add LICENSE to tar.gz archive

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>

---------

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-02-07 22:35:54 +02:00
kooomix
4ea35eec00 GitRegoStore moved to Regolibrary (#1058)
* GitRegoStore moved to Regolibrary

* httphandler go mod

* update go.mod

* test old regostorlibrary

* restore gitRegoStore from regolibrary

* Update 	github.com/kubescape/regolibrary to ver 249

Signed-off-by: kooomix <eranm@armosec.io>

* update go mod

Signed-off-by: kooomix <eranm@armosec.io>

* print scan_control_id mesg

Signed-off-by: kooomix <eranm@armosec.io>

* Update regolibrary version - windows host fix

Signed-off-by: kooomix <eranm@armosec.io>

---------

Signed-off-by: kooomix <eranm@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-02-07 13:18:51 +02:00
David Wertenteil
e8253d4193 Renaming the files (#1079)
* Renaming the files

Signed-off-by: David Wertenteil <dwertent@armosec.io>

* Removing un-used code

Signed-off-by: David Wertenteil <dwertent@armosec.io>

---------

Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 19:01:53 +02:00
David Wertenteil
8b8fe92072 Merge pull request #1078 from dwertent/master
Prepare for release
2023-02-06 16:31:54 +02:00
David Wertenteil
bcf9a10131 Remove host scanner warning message
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
b6d21ffd01 removed comments
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
086144c3da JSON version default v2
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
a45ee8ed42 update compliance url
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
129b0f3ee3 fix dockerbuild paths
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
01a8a34637 list files for upload
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
bcb6c06e73 update artifacts location
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
da03022b94 Change artifacts dir
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
17f313177c release with new tag
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:13 +02:00
David Wertenteil
a81353aa15 Leave release var empty for tests
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:12 +02:00
David Wertenteil
e0b82edd1e rename download dir
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:12 +02:00
David Wertenteil
b675d09fe2 rename build dir
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:12 +02:00
David Wertenteil
29b9448dc0 leaving release empty when testing PRs
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:12 +02:00
David Wertenteil
e1020dd1a6 saving file under build dir
Signed-off-by: David Wertenteil <dwertent@armosec.io>
2023-02-06 15:49:12 +02:00
David Wertenteil
9b734b1fa4 Merge pull request #1060 from kubescape/CIS-EKS-support
CIS EKS Support
2023-02-05 17:01:21 +02:00
YiscahLevySilas1
9f97f91f32 add context
Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io>
2023-02-05 12:03:10 +02:00
YiscahLevySilas1
c6eff8cbaa minor change 2023-02-05 11:54:21 +02:00
David Wertenteil
af9df548d6 Merge branch 'master' into CIS-EKS-support 2023-02-05 09:43:41 +02:00
David Wertenteil
786f3e6b41 Merge pull request #1074 from kubescape/add-otel-client
Add otel client
2023-02-05 09:35:54 +02:00
David Wertenteil
904751e117 Merge pull request #1075 from kubescape/revert-1073-new-wf-trigger
Revert "change wf trigger"
2023-02-02 16:40:09 +02:00
David Wertenteil
ce43661307 Revert "change wf trigger" 2023-02-02 16:39:16 +02:00
David Wertenteil
cd4b601557 Merge pull request #1044 from matthyx/otel
add otel with uptrace client
2023-02-02 16:37:18 +02:00
David Wertenteil
f34f1449db Merge pull request #1073 from kubescape/new-wf-trigger
change wf trigger
2023-02-01 21:16:40 +02:00
Matan Shkalim
16c74a228f change wf trigger
Signed-off-by: Matan Shkalim <shekel8@gmail.com>
2023-02-01 16:24:11 +00:00
David Wertenteil
ad01f01a6c Merge branch 'master' into otel 2023-01-31 23:09:02 +02:00
David Wertenteil
da0b9883ea Merge to master - PR number: 1070 2023-01-31 15:19:25 +02:00
Matan Shkalim
ac60dbed5e add new workflows + action
Signed-off-by: Matan Shkalim <shekel8@gmail.com>
2023-01-31 13:01:22 +00:00
Matthias Bertschy
3a90682c9e remove otel from CLI part
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-01-31 10:03:56 +01:00
Matthias Bertschy
160ac0db7c add otel with uptrace client
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-01-31 08:06:33 +01:00
David Wertenteil
7ec4fb75e3 Merge pull request #1067 from matthyx/fix-dockerfile
fix ksserver name in Dockerfile
2023-01-31 08:28:26 +02:00
Matthias Bertschy
7e88357940 fix ksserver name in Dockerfile
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-01-31 07:26:18 +01:00
YiscahLevySilas1
1ac808a935 Merge pull request #1063 from YiscahLevySilas1/dev
add unit test
2023-01-30 11:06:31 +02:00
yiscah
45fcc59b5f add unit test
Signed-off-by: yiscah <yiscahls@armosec.io>
2023-01-30 11:03:10 +02:00
YiscahLevySilas1
7875c14adf Merge pull request #1062 from YiscahLevySilas1/dev
update k8s-interface - fix in get region
2023-01-29 20:44:45 +02:00
yiscah
5cddba77aa update k8s-interface - fix in get region
Signed-off-by: yiscah <yiscahls@armosec.io>
2023-01-29 20:42:44 +02:00
YiscahLevySilas1
f3058bf168 Merge pull request #1061 from YiscahLevySilas1/dev
update k8s-interface - fix in get region
2023-01-29 20:34:46 +02:00
yiscah
0d1b92c2ee update k8s-interface - fix in get region
Signed-off-by: yiscah <yiscahls@armosec.io>
2023-01-29 20:32:12 +02:00
yiscah
8de308a5b1 go mod tidy 2023-01-29 09:44:28 +02:00
YiscahLevySilas1
a7f810f0d1 Merge pull request #1043 from YiscahLevySilas1/dev
Get cloud provider resources
2023-01-29 08:59:01 +02:00
Matthias Bertschy
e4e3071f5f Merge pull request #1057 from slashben/master
Progress bar in CLI
2023-01-27 17:52:08 +01:00
yiscah
9a7e61edd1 add cloud resource ListEntitiesForPolicies 2023-01-27 13:42:15 +02:00
Ben
5368330df9 updating httphandler
Signed-off-by: Ben <ben@armosec.io>
2023-01-26 09:40:36 +02:00
Ben
5e6a4cfb3f Checking for nil interface
Signed-off-by: Ben <ben@armosec.io>
2023-01-25 16:23:03 +02:00
Matthias Bertschy
052773b0dc Merge pull request #1022 from matthyx/krew
add kubectl plugin with krew
2023-01-25 08:44:28 +01:00
Matthias Bertschy
d462224b7a add kubectl plugin with krew
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2023-01-25 08:07:31 +01:00
yiscah
de1d8a9d86 improve cloud resources getters 2023-01-24 17:18:39 +02:00
Ben
d346b05b76 Fixing system test after API change
Signed-off-by: Ben <ben@armosec.io>
2023-01-24 14:13:19 +02:00
Ben
a3a61d65e9 Limiting the size of the name of controls in the pretty print of the tabel
Signed-off-by: Ben <ben@armosec.io>
2023-01-24 11:55:08 +02:00
Ben
606b0e77ca fixing progress to work on stderr
Signed-off-by: Ben <ben@armosec.io>
2023-01-24 11:55:08 +02:00
Ben
2a82d6cd21 Implementing progress bar for control processing
Signed-off-by: Ben <ben@armosec.io>
2023-01-24 11:55:08 +02:00
yiscah
530ffde50d Merge branch 'master' of https://github.com/kubescape/kubescape into dev 2023-01-23 18:52:43 +02:00
yiscah
7cf23e9730 Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2023-01-23 18:35:27 +02:00
David Wertenteil
8d5a8f8e22 Merge pull request #1056 from amirmalka/master
fixed a bug in install.sh script
2023-01-23 13:21:51 +02:00
Amir Malka
b820ce1311 fixed a bug in install.sh script in which default install directory /usr/local/bin was missing and not created
Signed-off-by: Amir Malka <amirm@armosec.io>
2023-01-23 11:30:29 +02:00
kooomix
dae2458867 Merge pull request #1055 from kooomix/hostsensor
Support in CNIInfo hostscanner API
2023-01-23 11:02:08 +02:00
David Wertenteil
d45e636b52 Merge pull request #1050 from vladklokun/retarget-1040-empty-framework-name
chore: retarget a ListFrameworks fix, suggest targeting master in PRs
2023-01-23 10:43:05 +02:00
kooomix
8810631d5c Support in CNIInfo 2023-01-23 09:50:07 +02:00
yiscah
6cddce7399 minor improvements in getting cloud resources 2023-01-22 12:11:58 +02:00
Vlad Klokun
5d5c4f2c9f docs: suggest targeting master instead of dev
Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
2023-01-20 17:30:50 +02:00
Frédéric BIDON
e37049f68e fix ListFrameworks (could return an empty element)
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2023-01-20 17:26:27 +02:00
Vlad Klokun
c717a9233b Merge pull request #1046 from fredbi/fix/1040-empty-framework-name
fix ListFrameworks (could return an empty element)
2023-01-20 17:16:31 +02:00
Frédéric BIDON
e37f47de3a fix ListFrameworks (could return an empty element)
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2023-01-20 14:06:51 +01:00
David Wertenteil
0622a474eb Merge pull request #1045 from kubescape/cosign-controls
Cosign controls
2023-01-19 18:45:04 +02:00
Daniel-GrunbergerCA
c357f12c82 add cosign functions for signature checking 2023-01-19 17:21:00 +01:00
yiscah
2cec58384a update go mod 2023-01-18 09:36:36 +02:00
yiscah
5e4bc5ddb8 get new cloud resource - DescribeRepositories 2023-01-18 09:25:50 +02:00
yiscah
f30752d9c3 Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2023-01-17 13:56:25 +02:00
David Wertenteil
a586549c57 Merge pull request #1039 from kubescape/release-on-new-tag
Update release flow
2023-01-15 14:50:54 +02:00
David Wertenteil
7c67a54230 Adding a screenshot 2023-01-15 11:20:56 +02:00
David Wertenteil
0006d7d8e7 Update release flow 2023-01-15 11:11:29 +02:00
David Wertenteil
63083ae48a Merge pull request #1037 from kubescape/dev
Release
2023-01-13 15:27:50 +02:00
David Wertenteil
2ce37bd66e Merge pull request #1036 from kubescape/update-logs
Update logs
2023-01-13 14:11:49 +02:00
David Wertenteil
13c760c116 Merge branch 'master' into dev 2023-01-13 14:06:54 +02:00
David Wertenteil
c6261e45a8 Merge pull request #1026 from kubescape/fix-command-indentation
Fix command indentation
2023-01-13 13:40:46 +02:00
David Wertenteil
0c06b6c3e6 enable --create-account flag 2023-01-13 13:27:05 +02:00
David Wertenteil
18a9ac3d6e adding debug logs 2023-01-13 13:26:36 +02:00
David Wertenteil
2bfe2a590c Merge pull request #1034 from matthyx/1032
only attempt to print existing attack graphs
2023-01-13 13:24:08 +02:00
David Wertenteil
fb54f4e6cf Merge pull request #945 from suhasgumma/fix-command1
Add support for fixing Individual Files using "fix" command
2023-01-13 13:23:37 +02:00
Vlad Klokun
9025ba5537 chore: reword unsupported scanning target error message 2023-01-13 12:47:07 +02:00
Vlad Klokun
0c23579db7 docs: clarify the comment adjusting the repoRoot 2023-01-13 12:47:07 +02:00
suhasgumma
a755f365df Fixed: Fix not working when multiple individual files are passed 2023-01-13 12:47:07 +02:00
suhasgumma
15f7b9f954 Add Comment 2023-01-13 12:47:07 +02:00
suhasgumma
92a2704fa6 Fix RelSource for Files 2023-01-13 12:47:07 +02:00
Vlad Klokun
a3defe3025 chore: keep CRLF in fixhandler test data file 2023-01-13 12:03:12 +02:00
David Wertenteil
2be0ef48d8 Merge pull request #1007 from matthyx/bitbucket
add support for Bitbucket scanning
2023-01-13 09:51:57 +02:00
Matthias Bertschy
c97513e4e8 only attempt to print existing attack graphs 2023-01-13 08:38:29 +01:00
Matthias Bertschy
1757c891aa add support for Bitbucket scanning 2023-01-13 07:35:07 +01:00
Vlad Klokun
b02410184e fix: follow newline conventions of the autofixed file
This change makes the autofix handler use the newline separator defined
in the fixed file for writing its changes.
2023-01-12 19:25:39 +02:00
David Wertenteil
b4a6a18a56 Merge pull request #1030 from dwertent/master
Update github workflows and temapltes
2023-01-12 14:14:03 +02:00
yiscah
571a68fb58 Merge branch 'dev' of https://github.com/YiscahLevySilas1/kubescape into dev 2023-01-12 14:10:30 +02:00
YiscahLevySilas1
ef306ca0bf Merge branch 'kubescape:dev' into dev 2023-01-12 14:10:20 +02:00
yiscah
1a011f4968 Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2023-01-12 14:09:35 +02:00
David Wertenteil
13ca0027a2 upgrade templates 2023-01-12 14:06:04 +02:00
Moshe Rappaport
93b626bb1e Merge pull request #1029 from dwertent/update-workflow
golangci-lint will setup go version 1.19
2023-01-12 13:48:53 +02:00
David Wertenteil
6b4310cd88 golangci-lint - continue-on-error 2023-01-12 13:46:12 +02:00
David Wertenteil
c883a297b3 do not run GH WF on none code dirs 2023-01-12 13:45:10 +02:00
David Wertenteil
3af351d91f Remove new pr welcome bot 2023-01-12 13:40:34 +02:00
David Wertenteil
93cde0f1a0 golangci-lint will setup go version 1.19 2023-01-12 13:38:29 +02:00
David Wertenteil
0a5715393c Merge pull request #1027 from kubescape/hot-fix-v2.0.181
setCloudMetadata only when scanning a cluster
2023-01-11 23:19:28 +02:00
David Wertenteil
9a1cc33efa setCloudMetadata only when scanning a cluster 2023-01-11 23:03:56 +02:00
Vlad Klokun
02720d32dd tests: extend test cases for autofix inserts
This change re-organizes the test cases for inserts performed by the
autofixing feature.
2023-01-11 20:21:22 +02:00
Vlad Klokun
ebada00cf1 tests: show diffs when comparing autofixes
This change refactors the TestApplyFixKeepsFormatting test to use
assert.Equalf so it will display a convenient diff between the expected
and actual fixing result.
2023-01-11 20:21:22 +02:00
Vlad Klokun
3b68fc94d1 tests: test fixing close to newline-separated keys in hybrid scenarios 2023-01-11 20:21:22 +02:00
Vlad Klokun
10d534b5bf tests: test autofixing files with comments between fields 2023-01-11 20:21:22 +02:00
Vlad Klokun
2d740fbf4f tests: test autofixing indented lists in hybrid scenarios 2023-01-11 20:21:22 +02:00
Vlad Klokun
d0728676ee tests: re-organize autofixing unit tests
This change:
- Changes test data naming convention to be lexicographically sortable
  and have input and expected data side-by-side.
- Executes each test case in a separate run.
2023-01-11 20:21:22 +02:00
suhasgumma
8856c84a17 fix: keep user formatting when autofixing 2023-01-11 20:21:12 +02:00
Amir Malka
0c87ff6843 Initial implementation of fix command (#898)
* Fix command initial implementation
2023-01-11 20:18:37 +02:00
David Wertenteil
a48d9be386 Merge pull request #1013 from fredbi/test/more-getter-tests
Refactored LoadPolicy getter, with unit tests
2023-01-11 13:46:08 +02:00
YiscahLevySilas1
3cece6cf35 Merge branch 'kubescape:dev' into dev 2023-01-11 12:25:16 +02:00
David Wertenteil
3c93c2c45c Merge pull request #1004 from darkweaver87/fix/panic
🐛 fix/panic
2023-01-11 12:06:01 +02:00
yiscah
7fc10e8213 revert changes 2023-01-11 12:05:56 +02:00
yiscah
bb8f0e3c46 Revert "start developing port forward to host scanner (doesn't work yet)"
This reverts commit 87e2986024.
2023-01-11 12:02:23 +02:00
yiscah
cfd85eadab Merge branch 'dev' of https://github.com/YiscahLevySilas1/kubescape into dev 2023-01-11 11:59:16 +02:00
David Wertenteil
77e0a04c99 fixed unit test 2023-01-11 11:31:30 +02:00
David Wertenteil
b8762b924c Merge branch 'dev' into test/more-getter-tests 2023-01-11 11:21:43 +02:00
David Wertenteil
025e75213a Merge pull request #1017 from matthyx/remotes
fix: branchRef.Remote can be a gitUrl
2023-01-11 09:01:31 +02:00
Craig Box
c39683872e Initial documentation update upon joining the CNCF (#1020)
* Initial refactor

Signed-off-by: Craig Box <craigb@armosec.io>

* Initial refactor.

Signed-off-by: Craig Box <craigb@armosec.io>

* Now how did that get in there?

Signed-off-by: Craig Box <craigb@armosec.io>

* small fixes

Signed-off-by: Craig Box <craigb@armosec.io>

* Use GitHub note and warning syntax

Signed-off-by: Craig Box <craigb@armosec.io>

* second guessing thing with no docs

Signed-off-by: Craig Box <craigb@armosec.io>

* Final changes

Signed-off-by: Craig Box <craigb@armosec.io>

Signed-off-by: Craig Box <craigb@armosec.io>
2023-01-11 08:53:55 +02:00
Matthias Bertschy
1a3a58a309 fix: branchRef.Remote can be a gitUrl 2023-01-11 07:48:31 +01:00
Matthias Bertschy
19438e6143 Merge pull request #1012 from anubhav06/azure-scanning
added Azure repo scanning support
2023-01-11 07:21:11 +01:00
Anubhav Gupta
284c8c737b Merge branch 'dev' of https://github.com/anubhav06/kubescape into azure-scanning 2023-01-10 23:30:11 +05:30
Anubhav Gupta
3441a65290 added Azure repo scanning support
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2023-01-10 23:29:35 +05:30
Frederic BIDON
773e43b1e1 refact(getter): refactored loadpolicy
* feat: added support for ListControls and GetFrameworks
* perf: introduced jsoniter unmarshalling for faster decoding
* introduced stricted error handling & predefined errors:
  * suppressed edge cases when a flaky value is returned instead of an error
* added full unit tests of LoadPolicy

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-09 14:48:18 +01:00
David Wertenteil
ddc0b2daf2 Merge pull request #1009 from fdingiit/v2.0.180-fix
bug fix for cannot read local artifacts
2023-01-09 13:15:59 +02:00
David Wertenteil
596686602c Merge pull request #1010 from fredbi/chore/slightly-more-linting
Chore/slightly more linting
2023-01-09 13:12:07 +02:00
Rémi BUISSON
5bb0c97f8f fix: panic on non-cluster scan 2023-01-09 10:34:08 +01:00
Rémi BUISSON
256db4abfb Revert "🐛 fix panic"
This reverts commit 08b8ae45432ddab5137b18347190b505f28e8389.
2023-01-09 08:56:48 +01:00
Rémi BUISSON
3546961a5e 🐛 fix panic 2023-01-09 08:56:48 +01:00
Frederic BIDON
e6dc7c2367 added unit tests to load policy getter
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 12:56:40 +01:00
dingfei
07fa3b4589 bug fix of cannot read local artifacts 2023-01-06 17:28:36 +08:00
Frederic BIDON
d6ed4b1aca finished added linters for this round
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:19 +01:00
Frederic BIDON
69846bb4c0 refactored load policy getter for Frameworks
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:18 +01:00
Frederic BIDON
2e5ad85fe0 simplified trivial expressions (gosimple)
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:18 +01:00
Frederic BIDON
1025431d64 fixed ineffectual assigns
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:18 +01:00
Frederic BIDON
1a863473e7 fixed goimports
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:17 +01:00
Frederic BIDON
28a44ac531 fixed leaking body on http response (bodyclose)
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:17 +01:00
Frederic BIDON
cf484c328b fixed issues reported by gover (e.g. shadowed variables)
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:17 +01:00
Frederic BIDON
668514e08d commented currently unused code
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:17 +01:00
Frederic BIDON
dc45efb6ef ensured gofmt
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:16 +01:00
Frederic BIDON
6d3844f187 follow-up on review following initial relinting
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-06 09:32:16 +01:00
Matthias Bertschy
4d6e85d4c7 Merge pull request #969 from fredbi/fix/conditional-build-for-git-support
Fix/conditional build for git support
2023-01-06 09:11:07 +01:00
Frederic BIDON
d336f4484c build(git): added build tag control over native git functionality
* fixes #964

* adapted build and ci to use build tag
* fixup error messages
* report git scan skipped warning & version
* fixed CI on windows: powershell parsing args...
* fixup leftover comment
* fixup typo in test message
* resolved merge conflicts on unit tests
* fix: added gitenabled tag to Makefile target

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2023-01-05 17:46:51 +01:00
David Wertenteil
bf263d8d51 Merge pull request #1006 from vladklokun/fix-missing-upstream-panic
Fix missing upstream panic
2023-01-05 13:35:03 +02:00
Vlad Klokun
cc3cf1932c style: go fmt the project 2023-01-05 12:49:19 +02:00
Vlad Klokun
6a4dc79689 fix: don’t panic when branch is missing remote and fallback
This change fixes the case in which Kubescape would panic when scanning
a local Git repository that:
- has the current branch that does not have an upstream set
- does not have an `origin` branch to fall back on

The panic happened because we did not check if the `origin` key exists
in the map of upstreams. This change adds a test for this scenario and
makes it pass by checking if the key exists. If it does not, it returns
an error.

Fixes #1005
2023-01-05 12:47:23 +02:00
David Wertenteil
8c189f6e3c Merge pull request #716 from pwnb0y/master
install.ps1 is modified to increase downloading speed as well as show progress bar
2023-01-05 08:28:47 +02:00
David Wertenteil
f1514d6e76 Merge pull request #1002 from kubescape/hot-fix-windows-url
update opa-utils pkg with URL parsing fixed
2023-01-03 22:39:07 +02:00
David Wertenteil
3a038c9a0e update opa-utils pkg with URL parsing fixed 2023-01-03 22:24:37 +02:00
David Wertenteil
b4bdf4d860 Release (#1000)
* fixed flaky loop(cautils): loadpolicy getter

We should not inject pointers to the variable iterated over by the
"range" operator.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>

* fixed more flaky pointers in loops (registryadaptors, opaprocessor)

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>

* fixed more flaky pointers in loops (resultshandling)

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>

* enabled golangci linter in CI

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>

* fixed linting issues with minimal linters config

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>

* bump go version to 1.19

* English and typos

* Support AKS parser (#994)

* support GKE parser

* update go mod

* support GKE parser

* update go mod

* update k8s-interface pkg

* Added KS desgin.drawio

* revert k8s.io to v0.25.3

* ran go mod tidy

* update sign-up url

* [wip] Adding CreateAccount support

* revert to docs URL

* update opa-utils pkg

* Print attack tree (optional, with argument) (#997)

* Print attack tree with the argument


Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
Co-authored-by: Frédéric BIDON <frederic@oneconcern.com>
Co-authored-by: Frédéric BIDON <fredbi@yahoo.com>
Co-authored-by: Oshrat Nir <45561829+Oshratn@users.noreply.github.com>
Co-authored-by: Amir Malka <amirm@armosec.io>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2023-01-03 11:30:09 +02:00
Amir Malka
b309cfca7a Print attack tree (optional, with argument) (#997)
* Print attack tree with argument

* fix
2023-01-03 08:46:50 +02:00
David Wertenteil
c4b3ef5b80 Support AKS parser (#994)
* support GKE parser

* update go mod

* Added KS desgin.drawio

* update k8s-interface pkg

* Added KS desgin.drawio

* support GKE parser

* update go mod

* update k8s-interface pkg

* Added KS desgin.drawio

* revert k8s.io to v0.25.3

* ran go mod tidy

* update sign-up url

* [wip] Adding CreateAccount support

* revert to docs URL

* update opa-utils pkg

* update opa-utils pkg
2023-01-03 08:44:29 +02:00
David Wertenteil
aba978e94a Merge pull request #996 from dwertent/bump-go-19
Bump go version to 1.19
2023-01-03 07:35:39 +02:00
David Wertenteil
a49781e9a8 Merge pull request #998 from Oshratn/patch-1
English and typos
2023-01-02 15:10:08 +02:00
Oshrat Nir
3ba19f55f1 English and typos 2023-01-02 14:55:27 +02:00
David Wertenteil
40a9b9406d Merge pull request #984 from fredbi/chore/introduce-linting
Chore/introduce linting
2023-01-02 08:48:14 +02:00
David Wertenteil
d6b8f5862f bump go version to 1.19 2022-12-28 23:18:03 +02:00
Frédéric BIDON
09f13c05e1 fixed linting issues with minimal linters config
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2022-12-26 17:47:10 +01:00
Frédéric BIDON
b1c8872a29 enabled golangci linter in CI
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2022-12-26 17:47:10 +01:00
Frédéric BIDON
22052f5869 fixed more flaky pointers in loops (resultshandling)
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2022-12-26 17:47:10 +01:00
Frédéric BIDON
afce43add6 fixed more flaky pointers in loops (registryadaptors, opaprocessor)
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2022-12-26 17:47:10 +01:00
Frédéric BIDON
4752364699 fixed flaky loop(cautils): loadpolicy getter
We should not inject pointers to the variable iterated over by the
"range" operator.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
2022-12-26 17:47:08 +01:00
David Wertenteil
08e7108dc0 Merge pull request #991 from kubescape/dev
Release
2022-12-22 18:12:37 +02:00
David Wertenteil
108a2d6dd8 Merge pull request #962 from anubhav06/gitlab-scan
added GitLab repo scanning support
2022-12-22 17:29:57 +02:00
David Wertenteil
2c28286bb1 update httphandler go mod 2022-12-22 17:07:47 +02:00
David Wertenteil
79858b7ed7 Merge pull request #975 from kooomix/dev
control scan and download only by id
2022-12-22 16:56:40 +02:00
David Wertenteil
bb2e83eb3b update go-git pkg 2022-12-22 16:55:11 +02:00
David Wertenteil
282a29b971 Merge pull request #990 from dwertent/cloud-name-breakdown
update config scanning path
2022-12-22 16:37:27 +02:00
David Wertenteil
60b9edc463 update config scanning path 2022-12-22 16:14:44 +02:00
David Wertenteil
0f9a5e3127 Merge pull request #989 from dwertent/cloud-name-breakdown
Breakdown cloud-cluster name
2022-12-22 16:03:31 +02:00
David Wertenteil
7c79c14363 Update core/pkg/resultshandling/results.go 2022-12-22 15:00:59 +02:00
Vlad Klokun
fe84225252 feat: notify about writing to an output file in PrettyPrinter 2022-12-22 15:00:59 +02:00
Vlad Klokun
56da8d8d92 style: tidy up the PDFPrinter
- Shorten receiver names
- Modify comments to follow Go Doc convention
2022-12-22 15:00:59 +02:00
Vlad Klokun
f135e95d2c style: shorten receiver names in JUnitPrinter 2022-12-22 15:00:59 +02:00
Vlad Klokun
db34183fc1 style: shorten receiver names in JSONPrinter 2022-12-22 15:00:59 +02:00
Vlad Klokun
8f3af71c84 style: shorten receiver names in HTML Printer 2022-12-22 15:00:59 +02:00
Vlad Klokun
116aee0c9c style: shorten receiver names in PrettyPrinter 2022-12-22 15:00:59 +02:00
Vlad Klokun
e5d44f741d docs: clarify new meaning of the --format CLI flag 2022-12-22 15:00:59 +02:00
Vlad Klokun
f005cb7f80 feat: always print to (T)UI using PrettyPrinter
Prior to this change, `pretty-printer` was a special type of Printer
that wrote output to `Stdout`, unless explicitly asked to write to a
given file. Kubescape used `pretty-printer` as an output format by
default. This behavior created the following inconsistencies:
- When invoked as `kubescape scan`, Kubescape would use `pretty-printer`
  by default, and it would output the scan resluts in the
  `pretty-printer` format to `Stdout`.
- When invoked as `kubescape scan --format=pretty-printer`, the behavior
  would be as above.
- When invoked as `kubescape scan --format=FORMAT`, where `FORMAT` is any
  format except for `pretty-printer`, Kubescape would write the results
  to a sensible default file for the selected format. This is in
  contrast to how `--format=pretty-printer` would still output to
  `os.Stdout`, and not an output file.
- When invoked as `kubescape scan --format=ANY_FORMAT --output=FILENAME`, where
  `ANY_FORMAT` is any format, including `pretty-printer`, Kubescape
  would write the results to the provided `FILENAME` in the given
  `ANY_FORMAT`, and not write any results to `Stdout`.

The aforementioned situation complicates life for users running
Kubescape in CI, where Kubescape would skip writing the results to
`Stdout` and only write to the provided output file.

Moreover, with the addition of support for multiple output formats and,
hence, files, this introduces the following ambiguity:
- When invoked as `kubescape scan --format=json,pdf,pretty-printer
  --output=FILENAME`, should Kubescape treat `pretty-printer` as a
  format for the output file, or just an instruction to also print the
  results to `Stdout`?

To fix these inconsistencies and ambiguities, this commit introduces the
following changes:

- Kubescape will always print results to `Stdout` using the
  PrettyPrinter format.

- The `--format` CLI flag will control the format(s) in which the results
  will be written to one or many *output* files. This breaks the
  previous behavior that running `kubescape scan
  --format=pretty-printer` would not produce an output file, and only
  write to `Stdout`. After this change, the same invocation will still
  write to `Stdout`, but also produce a `report.txt` file in the
  PrettyPrinter format.
2022-12-22 15:00:59 +02:00
Vlad Klokun
9ae9d35ccb style: GetFormatsFormats 2022-12-22 15:00:59 +02:00
Vlad Klokun
cb38a4e8a1 style: go fmt the project
- Fixes style inside the project with `go fmt`
2022-12-22 15:00:59 +02:00
Vlad Klokun
eb6d39be42 style: shorten receiver names in ResultsHandler 2022-12-22 15:00:59 +02:00
Vlad Klokun
3160d74c42 style: shorten receiver names for Prometheus printer 2022-12-22 15:00:59 +02:00
Vlad Klokun
5076c38482 refactor: tidy up printing to multiple outputs
This change:

- Simplifies printing to multiple outputs.
- Adds a comment on why we keep the Print → Score → Submit order when
  outputting results.
2022-12-22 15:00:59 +02:00
Vlad Klokun
73c55fe253 fix: revert the overriden ScanningTarget when submitting reports
Before this change, we used to override a scan info `ScanningTarget` to
submit a result that is compatible with the backend for Kubescape.
However, previously we forgot to change back to the original value.

When printing scan results, if the correct order of events (Print →
Score → Submit) was not enforced, this broke the SARIF printer so that
it did not output results due to incorrect `basePath` for the results.

This change reverts to the original `ScanningTarget` value after
submitting the results and fixes the SARIF printer.
2022-12-22 15:00:59 +02:00
suhasgumma
f48f81c0b5 Add logs for some formats 2022-12-22 15:00:59 +02:00
Suhas Gumma
81c1c29b7c Update core/pkg/resultshandling/printer/printresults.go
Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
2022-12-22 15:00:59 +02:00
suhasgumma
874aa38f68 Handle Output Extensions Gracefully 2022-12-22 15:00:59 +02:00
suhasgumma
b9caaf5025 Add logs for some formats 2022-12-22 15:00:59 +02:00
suhasgumma
61c120de0e Support getting outputs in multiple formats 2022-12-22 15:00:59 +02:00
kooomix
de3408bf57 minor fix 2022-12-22 14:09:27 +02:00
David Wertenteil
8d32032ec1 Merge branch 'cloud-name-breakdown' of github.com:dwertent/kubescape into cloud-name-breakdown 2022-12-22 13:33:23 +02:00
David Wertenteil
42ed787f7b update go mod in httphandler 2022-12-22 13:32:27 +02:00
David Wertenteil
ccdba85b3c Merge branch 'dev' into cloud-name-breakdown 2022-12-22 11:57:47 +02:00
David Wertenteil
c59f7691dc Breakdown cloud-cluster name 2022-12-22 11:43:45 +02:00
kooomix
cf87c2d30b Fixed test 2022-12-21 19:25:22 +02:00
kooomix
b547814dec DownloadInfo, PolicyIdentifier add Identity, remove ID and Name 2022-12-21 19:17:29 +02:00
kooomix
b476a72e04 Merge branch 'dev' of github.com:kooomix/kubescape into dev 2022-12-21 17:02:24 +02:00
kooomix
4f6f85710a Merge pull request #988 from kooomix/opa_utils-v.0.0.216
opa-utils v0.0.216
2022-12-21 16:06:34 +02:00
kooomix
47c23de160 opa-utils v0.0.216 2022-12-21 15:46:53 +02:00
kooomix
bc85844ec0 Merge branch 'kubescape:dev' into dev 2022-12-21 15:31:07 +02:00
kooomix
134d854722 opa-utils v0.0.216 2022-12-21 15:29:58 +02:00
David Wertenteil
e3522c19cc Merge pull request #986 from dwertent/master
Cosmetic changes
2022-12-20 10:33:21 +02:00
David Wertenteil
967fc3fe81 ignore resource if it is not found 2022-12-19 19:00:21 +02:00
David Wertenteil
896a0699ec remove image vuln warning 2022-12-18 13:45:43 +02:00
David Wertenteil
a53375204e remove --verbose flag from default 2022-12-18 13:44:12 +02:00
David Wertenteil
b1392361f8 remove emoji from display 2022-12-18 13:42:58 +02:00
David Wertenteil
7b4fbffae2 Merge pull request #976 from mkilchhofer/explicit_allowPrivilegeEscalation
chore: Explicit set allowPrivilegeEscalation=true
2022-12-18 08:09:35 +02:00
David Wertenteil
34e7b9f2ad Merge pull request #978 from kubescape/maintainers
Update maintainers
2022-12-18 08:08:20 +02:00
David Wertenteil
f0080bdeae Merge pull request #979 from craigbox/code-of-conduct
Adopt CNCF Code of Conduct.
2022-12-18 08:07:39 +02:00
Craig Box
0eb27389da Adopt CNCF Code of Conduct.
Signed-off-by: Craig Box <craigb@armosec.io>
2022-12-16 21:46:31 +13:00
craigbox
2c5eed9ee2 Update maintainers
- Add self
- Remove e-mail addresses & job roles
2022-12-16 21:19:02 +13:00
yiscah
87e2986024 start developing port forward to host scanner (doesn't work yet) 2022-12-15 19:03:44 +02:00
David Wertenteil
2c1a5bd032 Merge pull request #977 from kubescape/revert-973-dev
Revert "Excluding controlPlaneInfo from error message in case no data recieved."
2022-12-15 17:48:32 +02:00
David Wertenteil
298f8346e9 validate downloaded framework 2022-12-15 17:13:14 +02:00
kooomix
1897c5a4ba Revert "Excluding controlPlaneInfo from error message in case no data recieved." 2022-12-15 16:17:39 +02:00
Marco Kilchhofer
57e435271e chore: Explicit set allowPrivilegeEscalation=true
The value of allowPrivilegeEscalation followed implicit default of Kubernetes:
> AllowPrivilegeEscalation is true always when the container is:
> 1) run as Privileged
> 2) has CAP_SYS_ADMIN

For users still using PodSecurityPolicy (or a follow-up product like OPA Gatekeeper or
Kyverno), there might be mutating admission controllers which defaults this field to
`false` if unset. A value of `false` would then conflict with `privileged: true`.

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-12-14 22:27:05 +01:00
kooomix
7e9b430347 test fix 2022-12-14 14:22:46 +02:00
kooomix
ca5b3e626b test fix 2022-12-14 14:08:32 +02:00
kooomix
3a404f29fa control scan by id 2022-12-14 13:42:52 +02:00
kooomix
16073d6872 download control only by id 2022-12-14 13:06:04 +02:00
Rotem Refael
dce563d2f5 Merge pull request #973 from kooomix/dev
Excluding controlPlaneInfo from error message in case no data recieved.
2022-12-14 11:02:55 +02:00
kooomix
8d556a5b84 minor 2022-12-14 10:48:01 +02:00
kooomix
a61063e5b8 revert opa-utils version 2022-12-14 10:45:24 +02:00
kooomix
94973867db Merge branch 'kubescape:dev' into dev 2022-12-14 10:23:11 +02:00
kooomix
214c2dcae8 patch to filter out "controlPlaneInfo" from error messages in case no data 2022-12-14 10:19:24 +02:00
David Wertenteil
72b36bf012 Merge pull request #968 from fredbi/chore/package-name
chore(style): renamed versioned packages to stick to idiomatic conventions
2022-12-13 16:52:57 +02:00
Frederic BIDON
4335e6ceac chore(style): renamed versioned packages to stick to idiomatic conventions
* fixes: #967

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2022-12-13 14:27:21 +01:00
kooomix
b5f92a7d54 go mod tidy 2022-12-13 11:32:23 +02:00
kooomix
41ec75d264 update opa-utils v0.0.209 2022-12-13 11:20:17 +02:00
kooomix
6d6ad1f487 Merge pull request #963 from kooomix/outputs_to_get_controls_only_by_ids
All prints and outputs to get data only by control ID
2022-12-13 08:32:01 +02:00
kooomix
3ac33d21ac All prints and outputs to get data by control ID 2022-12-12 15:20:48 +02:00
Anubhav Gupta
04e4b37f6f added GitLab repo scanning support
Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2022-12-11 21:39:28 +05:30
David Wertenteil
3e5903de6a Merge pull request #961 from kubescape/dev
change linux runner to 20.04 instead of ubuntu-latest (#960)
2022-12-11 15:02:04 +02:00
Moshe Rappaport
04ea0fe524 change linux runner to 20.04 instead of ubuntu-latest (#960)
Co-authored-by: Amir Malka <amirm@armosec.io>
2022-12-11 14:20:28 +02:00
David Wertenteil
955d6751a9 Merge pull request #956 from kubescape/dev
Enhance `host-scanner`
2022-12-08 22:51:26 +02:00
David Wertenteil
30c43bff10 Merge pull request #958 from Moshe-Rappaport-CA/dev
Fix Junit format
2022-12-08 19:41:31 +02:00
Moshe-Rappaport-CA
e009244566 Fix Junit format 2022-12-08 17:56:16 +02:00
David Wertenteil
3d3cd2c2d8 Added Kubescape flow.drawio 2022-12-06 15:44:34 +02:00
David Wertenteil
f5498371ec Merge pull request #942 from kooomix/eran-dev
new host-scanner endpoint - cloudProviderInfo
2022-12-06 15:20:24 +02:00
David Wertenteil
c3b95bed8c Merge branch 'dev' into eran-dev 2022-12-06 14:17:49 +02:00
David Wertenteil
8ce7d6c0f6 Merge pull request #930 from JusteenR/issue929
Issue929
2022-12-06 14:15:35 +02:00
David Wertenteil
e875f429a9 Merge pull request #948 from YiscahLevySilas1/dev
Print host scanner version
2022-12-06 14:13:47 +02:00
David Wertenteil
b6beff0488 Merge pull request #946 from suhasgumma/dev
Fixed: CIS control link not working for html output format
2022-12-06 14:13:06 +02:00
David Wertenteil
60c69ac3f0 Merge pull request #950 from fredbi/fix-789
fix(giturlparse): fixes panic on unexpected gitlab remote URL
2022-12-06 14:12:25 +02:00
David Wertenteil
1fb9320421 Merge pull request #941 from dwertent/master
Updating examples
2022-12-06 14:11:07 +02:00
David Wertenteil
9a176f6667 remove tag latest 2022-12-06 11:42:34 +02:00
David Wertenteil
96ea9a9e42 fixed scanning example 2022-12-06 11:41:12 +02:00
David Wertenteil
e39fca0c11 do not build dev images 2022-12-06 11:05:21 +02:00
David Wertenteil
2ec035005d fixed echo command 2022-12-04 15:45:23 +02:00
Frederic BIDON
b734b3aef0 go mod tidy ancillary modules manifest
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2022-12-04 12:39:34 +01:00
yiscah
0f5635f42d move parsing of version to GetVersion 2022-12-04 12:17:04 +02:00
Frederic BIDON
8557075b7c fix(giturlparse): fixes panic on unexpected gitlab remote URL
* replaced dependencies to github.com/armosec/go-git-url by
github.com/kubescape/go-git-url
* fixes #789

NOTE: this requires kubescape/go-git-url#2 to be merged, a new release
of that repo to be cut, in order to finalize the dependency update.

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
2022-12-02 16:09:25 +01:00
David Wertenteil
bc0f0e7087 Merge branch 'master' of github.com:dwertent/kubescape 2022-12-02 02:31:14 +02:00
David Wertenteil
8ce5f9aea3 fixed typo 2022-12-02 02:30:35 +02:00
David Wertenteil
050f9d3a4e Update cmd/scan/framework.go
Co-authored-by: craigbox <craig.box@gmail.com>
2022-12-02 02:16:43 +02:00
David Wertenteil
a81bf0deb4 deprecate set-output 2022-12-02 01:43:45 +02:00
David Wertenteil
2059324c27 testing release 2022-12-02 01:35:57 +02:00
David Wertenteil
a09a0a1bca Merge pull request #9 from dwertent/fix-dev-image
run build only if secret is set
2022-12-02 01:32:26 +02:00
David Wertenteil
83712bb9f5 run build only if secret is set 2022-12-02 01:30:24 +02:00
David Wertenteil
728ae47b9a Merge pull request #8 from dwertent/fix-dev-image
Fix dev image
2022-12-02 00:56:12 +02:00
David Wertenteil
2a9b272a14 tagging only main image as latest 2022-12-02 00:54:03 +02:00
David Wertenteil
8662deac43 update repository scanning URL 2022-12-02 00:42:28 +02:00
yiscah
e42644bbd8 update hostscanner version 2022-12-01 08:57:58 +02:00
YiscahLevySilas1
07d30b6272 Merge branch 'kubescape:dev' into dev 2022-11-30 20:52:48 +02:00
yiscah
2a4f8543cc added logs of host scanner version 2022-11-30 20:51:45 +02:00
suhasgumma
186b293cce fix link for cis controls in html output 2022-11-30 01:23:45 +05:30
David Wertenteil
2bfe72f39d Merge pull request #944 from kooomix/dev
opa-utils adjustments + dataControlInputs support
2022-11-29 19:11:49 +02:00
kooomix
f99f955223 go mod tidy 2022-11-29 15:26:30 +02:00
kooomix
ec56e69a3c minor fix 2022-11-29 14:55:30 +02:00
kooomix
3942583b1d Merge pull request #1 from kooomix/dataControlInputs
update opa-utils functions
2022-11-29 14:35:08 +02:00
kooomix
a10b15ba4b update opa-utils functions 2022-11-29 14:29:33 +02:00
David Wertenteil
5003cbd7a8 Merge pull request #943 from suhasgumma/invalidformat
Handle Invalid Formats
2022-11-28 17:39:14 +02:00
kooomix
481a137c23 Update host-scanner image version to v1.0.38 2022-11-28 16:46:32 +02:00
suhasgumma
c3f7f0938d Handle Invalid Formats 2022-11-28 19:56:27 +05:30
kooomix
b1925fa38d Support in new host-scanner endpoint - cloudProviderInfo 2022-11-28 09:18:43 +02:00
David Wertenteil
d9f8a7a46f Merge pull request #918 from suhasgumma/dev1
Store Git Repo's root path as localRootPath
2022-11-27 16:25:24 +02:00
David Wertenteil
846a072bf9 Merge pull request #917 from suhasgumma/dev
Fixed: Wrong Relative Path When scanning Local Directory
2022-11-27 16:24:19 +02:00
kooomix
5dd7bbd8a7 Merge pull request #938 from kooomix/eran-dev
Added cloudProvider to postureControlInputs
2022-11-27 09:06:56 +02:00
kooomix
e1773acf24 Getting cloud provider from gitversion of discovered API version 2022-11-25 09:27:27 +02:00
kooomix
03a0f97669 Getting cluster name from context 2022-11-24 16:09:05 +02:00
David Wertenteil
917a3f41e8 Merge pull request #925 from amirmalka/dev
Omit raw resources flag in json output
2022-11-24 14:47:14 +02:00
David Wertenteil
3c8da1b299 supporting client type from env 2022-11-24 11:09:30 +02:00
David Wertenteil
c61c7edbd0 update examples 2022-11-24 11:06:37 +02:00
kooomix
53402d9a1c Added "CloudProvider" to postureControlInputs 2022-11-23 11:57:36 +02:00
David Wertenteil
de9278b388 Merge pull request #935 from mkilchhofer/bugfix/use_correct_directory
fix: filepath.Dir requires trailing slash
2022-11-23 10:49:16 +02:00
Marco Kilchhofer
4fef6200f8 fix: filepath.Dir requires trailing slash
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-11-22 21:26:37 +01:00
JusteenR
81771b7bd7 Adding frameworks column to control command 2022-11-20 15:42:13 -08:00
Moshe Rappaport
2fee77c42c Merge pull request #928 from Moshe-Rappaport-CA/PER-633-support-loading-exceptions-from-cache-kubescape
PER-633 support loading exceptions from cache
2022-11-20 14:09:30 +02:00
Moshe-Rappaport-CA
968ecdb31d PER-633 support loading exceptions from cache 2022-11-20 12:22:15 +02:00
David Wertenteil
af7b36a88b Merge pull request #927 from Moshe-Rappaport-CA/PER-550-support-loading-attack-tracks-from-cache-kubescape
Per 550 support loading attack tracks from cache kubescape
2022-11-20 11:24:38 +02:00
Moshe-Rappaport-CA
6ad58d38e2 PER-550 Support loading attack tracks from cache 2022-11-17 16:31:51 +02:00
Moshe-Rappaport-CA
681b4ce155 stash 2022-11-17 10:49:36 +02:00
Moshe Rappaport
9d21ac1b16 Merge pull request #924 from Moshe-Rappaport-CA/dev
revert change in Junit format
2022-11-16 15:36:48 +02:00
Amir Malka
2b3fcca7e8 omit raw resources flag in json output 2022-11-16 12:15:17 +02:00
David Wertenteil
af8e786ab5 Merge pull request #914 from kubescape/dev
Closing issues
2022-11-16 10:59:59 +02:00
Moshe-Rappaport-CA
c8df1b8f1f Merge remote-tracking branch 'armo/dev' into dev 2022-11-15 17:34:45 +02:00
Moshe-Rappaport-CA
4f921ddf6f Revert PR #802 to the old junit format 2022-11-15 16:59:37 +02:00
David Wertenteil
4f5839870b Merge pull request #920 from amirmalka/dev
Fixed docker build to support ARM #919
2022-11-15 14:53:20 +02:00
Amir Malka
c0d7f51d6c test build flow 2022-11-15 13:29:35 +02:00
Amir Malka
a81d770360 fixed docker build to support arm 2022-11-15 10:57:29 +02:00
suhasgumma
f64d5eab50 Fix RootDir Info 2022-11-15 12:38:57 +05:30
suhasgumma
d773397fe9 replace src with RelSrc 2022-11-15 10:34:36 +05:30
suhasgumma
2e30995bfc Relative Path When scanning Local Repos 2022-11-15 10:22:04 +05:30
David Wertenteil
17a2547f18 Merge pull request #915 from kubescape/change-test-control-name
replace control 0006 by 0048
2022-11-14 14:56:34 +02:00
David Wertenteil
87a5cd66c8 replace control 0006 by 0048 2022-11-14 14:36:37 +02:00
David Wertenteil
9436ace64f continue when resource not found 2022-11-14 13:52:46 +02:00
David Wertenteil
fde00f6bd8 Merge pull request #909 from suhasgumma/dev
pretty-print Controls format  made Pretty
2022-11-13 17:04:46 +02:00
David Wertenteil
04a72a069a Merge pull request #913 from dwertent/ignore-missing-resource
Do not exit on error
2022-11-13 16:04:15 +02:00
David Wertenteil
e2dcb5bc15 Merge pull request #912 from dwertent/dep-rbac-submit
Deprecate rbac submit
2022-11-13 16:03:51 +02:00
suhasgumma
c7040a257c Pretty Print frameworks and exceptions 2022-11-13 19:29:26 +05:30
suhasgumma
602dc00c65 Shift GetControlLink to cautils 2022-11-13 19:09:30 +05:30
David Wertenteil
0339691571 Merge pull request #911 from dwertent/adding-remidiation
Adding remediation
2022-11-13 15:12:21 +02:00
David Wertenteil
9e1f3ec131 remove from smoke test 2022-11-13 15:10:05 +02:00
David Wertenteil
b8589819dc Do not exit on error 2022-11-13 15:06:32 +02:00
David Wertenteil
a3e87f4c01 Updating json v1 deprecation message 2022-11-13 15:03:22 +02:00
David Wertenteil
21ab5a602e Deprecate rbac submit 2022-11-13 15:01:32 +02:00
David Wertenteil
5d97d7b4b2 adding Remediation to message 2022-11-13 14:55:52 +02:00
suhasgumma
d8d7d0b372 Updated and Used GetControlLink 2022-11-13 17:56:39 +05:30
suhasgumma
b8323d41fc Modified Link Convention for CIS Controls 2022-11-13 17:22:37 +05:30
suhasgumma
d0b5314201 Improve Code Quality 2022-11-13 15:39:04 +05:30
suhasgumma
547e36e73f Pretty Print Controls made Pretty 2022-11-13 14:29:30 +05:30
David Wertenteil
e593a772cb Merge pull request #908 from Moshe-Rappaport-CA/update-k8s-interface-version
Update k8s-interface version and rbac-utils
2022-11-13 09:31:00 +02:00
Moshe-Rappaport-CA
4da09529b6 Update rbac-utils tag 2022-11-10 18:56:28 +02:00
Moshe-Rappaport-CA
de375992e8 Fix go.mod in httphandler 2022-11-10 17:54:44 +02:00
Moshe-Rappaport-CA
0bc4a29881 Update k8s-interface version 2022-11-10 17:38:32 +02:00
David Wertenteil
9575c92713 Merge pull request #906 from suhasgumma/dev
Fixed: Empty Lines before printing Controls and Added Invalid Format Error
2022-11-10 11:27:22 +02:00
David Wertenteil
cf277874eb Merge pull request #907 from matthyx/ioutil
remove deprecated ioutil package
2022-11-10 11:23:10 +02:00
Matthias Bertschy
746e060402 remove deprecated ioutil package 2022-11-10 09:58:07 +01:00
suhasgumma
dd3a7c816e Invalid Format Error 2022-11-10 11:57:57 +05:30
suhasgumma
814bc3ab2c Solved: Empty Lines before printing Controls 2022-11-10 11:17:48 +05:30
David Wertenteil
dbaf6761df Merge pull request #905 from matthyx/900
900
2022-11-10 06:52:34 +02:00
Matthias Bertschy
580e45827d add IDs to controls list, deprecate id flag 2022-11-09 22:08:04 +01:00
David Wertenteil
f3b8de9d1f fixing readme (#899) 2022-11-08 12:02:52 +02:00
David Wertenteil
fb1c728b12 Merge pull request #897 from Moshe-Rappaport-CA/fix-use-artifact-from
Fix reading frameworks from local file
2022-11-06 17:34:44 +02:00
Moshe-Rappaport-CA
6964ca0d18 Fix reading frameworks from local file 2022-11-06 17:06:27 +02:00
David Wertenteil
6e9a2f55fd Merge pull request #894 from kubescape/dev
Enhancing CLI capabilities and SARIF output
2022-11-06 15:40:00 +02:00
David Wertenteil
691fa61362 Merge pull request #896 from kubescape/revert-submit-dep
Revert submit deprecation
2022-11-06 15:06:49 +02:00
David Wertenteil
0c1eda0d08 retrieve submit flag 2022-11-03 20:33:10 +02:00
David Wertenteil
767eac2fa6 fixed indentation 2022-11-03 20:31:59 +02:00
David Wertenteil
6f651fa2d0 Merge pull request #893 from amirmalka/dev
Added line and column information when using the SARIF format
2022-11-03 15:38:33 +02:00
Amir Malka
e3362c2e3d updated go.mod 2022-11-03 14:38:07 +02:00
Amir Malka
08b8b68f9a added line and column information when using the sarif format 2022-11-03 14:08:53 +02:00
Amir Malka
daf9ca9e7f Merge pull request #825 from AvineshTripathi/feature
added adaptor
2022-11-03 12:48:23 +02:00
Amir Malka
d1024359c9 fix dependencies 2022-11-03 12:15:13 +02:00
Amir Malka
ed6070aff9 fix go.sum 2022-11-03 12:10:34 +02:00
Amir Malka
e4dbfa3534 Merge branch 'dev' into feature 2022-11-03 11:05:10 +02:00
Avinesh Tripathi
ddd2b707c0 updated go.mod 2022-11-03 14:17:53 +05:30
David Wertenteil
cd4f1077c2 Merge pull request #892 from Moshe-Rappaport-CA/dev
Add support to exceptions on repo (files) scan
2022-11-03 10:07:10 +02:00
Moshe-Rappaport-CA
b472d1cb9d Remove irrelevant code 2022-11-03 09:52:36 +02:00
David Wertenteil
922e2548f4 Merge pull request #888 from suhasgumma/dev
Inform User if something is wrong with "controls-inputs" file they provided
2022-11-03 09:38:27 +02:00
suhasgumma
45caa7c120 Adding Log in Caller Function 2022-11-03 07:35:52 +05:30
Moshe-Rappaport-CA
670ae45d62 remove --submit from msg when not submitted 2022-11-02 16:27:40 +02:00
Moshe-Rappaport-CA
05bcf018d1 Merge remote-tracking branch 'armo/dev' into dev 2022-11-02 15:02:30 +02:00
David Wertenteil
0af5d2e0bb Merge pull request #876 from Moshe-Rappaport-CA/PER-335-removing-support-for-submitting-results-without-accountid
Per 335 removing support for submitting results without accountid
2022-11-02 12:55:20 +02:00
Moshe-Rappaport-CA
eaf05fe9be Add support to exceptions on repo (files) scan 2022-11-02 12:49:14 +02:00
David Wertenteil
e97b23f345 remove platforms build 2022-11-02 12:45:18 +02:00
David Wertenteil
83a00ded3d removed log 2022-11-02 12:43:03 +02:00
Avinesh Tripathi
78f81cc968 Merge branch 'dev' into feature 2022-10-31 21:56:13 +05:30
Avinesh Tripathi
5d3347b4fe Added Path variables for credentials 2022-10-31 21:54:10 +05:30
David Wertenteil
64d2ef8170 Merge pull request #887 from Moshe-Rappaport-CA/dev
Support downloading system-exception from GitHub
2022-10-30 12:57:49 +02:00
suhasgumma
7c1e360b9a Error Info Added 2022-10-28 18:25:10 +05:30
Moshe Rappaport
575d36dcde Update core/core/initutils.go
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2022-10-27 18:30:06 +03:00
Moshe-Rappaport-CA
8dba8f7491 Add go sum 2022-10-27 18:25:46 +03:00
Moshe-Rappaport-CA
cc39e5b905 Fix go mod and go sum 2022-10-27 18:18:26 +03:00
Moshe-Rappaport-CA
0be7e6018f Support downloading system-exception from GitHub 2022-10-27 17:59:41 +03:00
David Wertenteil
7697e3f0c4 Merge pull request #884 from Moshe-Rappaport-CA/dev
Scanning with include or exclude namespace, is only scan namespaced scope
2022-10-26 19:04:02 +03:00
David Wertenteil
379800c49f Merge pull request #885 from vladklokun/per-519-add-sarif-printer
feat: support the SARIF output format
2022-10-26 19:02:21 +03:00
Vlad Klokun
79e2515807 feat: support the SARIF output format 2022-10-26 18:13:37 +03:00
Moshe-Rappaport-CA
342f5743e2 Fix when running with include or exclude namespace
scanning only namespaced scope
2022-10-26 16:29:55 +03:00
David Wertenteil
0e81870b85 Merge pull request #799 from itsCheithanya/master
Add update command for kubescape
2022-10-26 15:46:03 +03:00
David Wertenteil
dd7a8fd0c1 Merge pull request #883 from kubescape/dev
Minor changes
2022-10-26 13:31:04 +03:00
David Wertenteil
4277331ee2 Merge pull request #882 from dwertent/master
Update README links
2022-10-26 13:04:00 +03:00
David Wertenteil
53561a728f Merge pull request #872 from BhairaviSanskriti/dev
Added tutorial for scanning container image registry
2022-10-26 13:00:45 +03:00
David Wertenteil
d0fd8c4fe4 Merge pull request #869 from shm12/master
APIServerInfo resource added to the scan
2022-10-26 12:59:51 +03:00
David Wertenteil
398989510b Merge pull request #881 from YiscahLevySilas1/dev
update hostsensor version
2022-10-26 12:56:55 +03:00
Amir Malka
f8e3ad5685 Merge pull request #845 from mrueg/Yamlv3
Upgrade to gopkg.in/yaml.v3
2022-10-26 12:56:31 +03:00
Moshe-Rappaport-CA
fbea7ef874 Merge remote-tracking branch 'armo/dev' into dev 2022-10-26 12:11:42 +03:00
YiscahLevySilas1
dc2c6f8a21 update hostsensor version 2022-10-26 11:40:28 +03:00
Amir Malka
5ee08583b6 Merge pull request #880 from amirmalka/dev
commented out tests which made actual http calls
2022-10-25 18:45:38 +03:00
Amir Malka
bfbd278e7c commented out tests which made actual http calls 2022-10-25 18:26:07 +03:00
David Wertenteil
4c6e5903e3 Adding links to readme 2022-10-25 09:49:43 +03:00
David Wertenteil
a7cd5672c1 Merge remote-tracking branch 'armosec/dev' 2022-10-24 17:23:41 +03:00
David Wertenteil
3373b728b7 Merge pull request #877 from kubescape/dev
Enhance configuration usage
2022-10-24 12:00:27 +03:00
David Wertenteil
22521b7159 use os path join in build file 2022-10-24 11:39:37 +03:00
David Wertenteil
e5fb14138e adding github token 2022-10-23 20:48:36 +03:00
David Wertenteil
1b2242330c comment out image release 2022-10-23 20:35:13 +03:00
David Wertenteil
356958cc55 Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2022-10-23 20:30:18 +03:00
Moshe Rappaport
8f1da32001 Store default URLs in cache (#875) 2022-10-23 20:29:25 +03:00
Moshe-Rappaport-CA
686352a397 PER-335 Fix comments 2022-10-23 16:54:16 +03:00
Moshe-Rappaport-CA
ef79c42ebc PER-335 Add comment 2022-10-23 16:25:47 +03:00
Moshe-Rappaport-CA
c8fc5378c1 PER-335 Remove submit option from kubescape docs 2022-10-23 16:19:38 +03:00
David Wertenteil
c296666d8e removed path from dockerfile 2022-10-23 16:00:10 +03:00
Moshe-Rappaport-CA
f193e260b0 Store default URLs in cache 2022-10-23 15:56:49 +03:00
Moshe-Rappaport-CA
82981a9a54 PER-335 Removing support for submitting results without accountID 2022-10-23 13:48:50 +03:00
David Wertenteil
3be54ca484 fixed typo 2022-10-23 12:35:54 +03:00
shm12
2f2c177674 Merge pull request #873 from shm12/dev
Fixed host-sensor control plane info collecting
2022-10-23 11:12:07 +03:00
shm12
1f47223918 Fixed host-sensor control plane info collecting 2022-10-23 10:46:44 +03:00
Sanskriti
eb646696a3 Update README.md
This is a video tutorial by Kunal Kushwaha on how to scan a container image registry.
2022-10-21 10:42:02 +05:30
Moshe Rappaport
7cfe5160d5 Merge pull request #871 from Moshe-Rappaport-CA/dev
Support for getting backend URLs from ENV
2022-10-20 10:44:32 +03:00
Moshe-Rappaport-CA
95135c4379 following review 2022-10-19 18:52:32 +03:00
Moshe-Rappaport-CA
7e604d6a5b Merge remote-tracking branch 'armo/dev' into dev 2022-10-19 13:29:09 +03:00
Moshe-Rappaport-CA
64ac2666f9 Support for getting backend URLs from ENV 2022-10-19 13:28:44 +03:00
Avinesh Tripathi
05b3459342 Merge branch 'dev' into feature 2022-10-19 13:44:27 +05:30
shm12
92ad5f2407 Merge pull request #868 from shm12/dev
New host sensor endpoint `controlPlaneInfo` and OPA upgrade
2022-10-18 16:14:36 +03:00
shm12
e3c60e3202 APIServerInfo resource added to the scan 2022-10-12 22:52:42 +03:00
shm12
7b5bcb05b1 Upgrade opa dependency 2022-10-12 20:51:50 +03:00
shm12
154f94a0af Added controlPlaneInfo host-sensor endpoint 2022-10-12 20:51:06 +03:00
David Wertenteil
063d3ee313 Adopt custom cluster name (#862)
* change user to ks

* update logs

* host scanner with fixed version

* testing gh actions

* testing gh actions

* Workflow call testing (#7)

* testing gh actions

* testing gh actions

* remove deps

* build multi platforms

* workflow_call testing

* adding workflow-call-testing branch name

* specify URL

* adding org name

* adding workflows

* cleaning from unused branches

* Adopt custom cluster name
2022-10-06 11:04:05 +03:00
David Wertenteil
79859d05c0 Merge remote-tracking branch 'armosec/dev' 2022-10-06 08:16:27 +03:00
David Wertenteil
acd3a94c46 Adopt custom cluster name 2022-10-06 08:15:58 +03:00
Alessio Greggi
13f09315e7 feat: add --kubeconfig flag (#858)
* feat: add --kubeconfig flag

* docs: add kubeconfig flag example
2022-10-06 08:11:42 +03:00
Manuel Rüger
890528bf14 Update go.mod 2022-10-03 21:21:31 +02:00
Manuel Rüger
e4aafcf81e Migrate to yaml.v3 2022-10-03 21:20:15 +02:00
David Wertenteil
81c3c34ab8 Use workflow_call (#859)
* change user to ks

* update logs

* host scanner with fixed version

* testing gh actions

* testing gh actions

* Workflow call testing (#7)

* testing gh actions

* testing gh actions

* remove deps

* build multi platforms

* workflow_call testing

* adding workflow-call-testing branch name

* specify URL

* adding org name

* adding workflows

* cleaning from unused branches
2022-10-03 14:36:44 +03:00
David Wertenteil
b7b83b26b5 cleaning from unused branches 2022-10-03 14:35:07 +03:00
David Wertenteil
639cd3dfae Merge branch 'master' of github.com:dwertent/kubescape 2022-10-03 13:52:44 +03:00
David Wertenteil
7cf1302e8a Workflow call testing (#7)
* testing gh actions

* testing gh actions

* remove deps

* build multi platforms

* workflow_call testing

* adding workflow-call-testing branch name

* specify URL

* adding org name

* adding workflows
2022-10-03 13:48:50 +03:00
David Wertenteil
dd5dd53a38 testing gh actions 2022-10-03 09:10:08 +03:00
David Wertenteil
7275b8eac7 testing gh actions 2022-10-03 09:09:50 +03:00
David Wertenteil
408c6fc998 Merge branch 'master' of github.com:dwertent/kubescape 2022-10-03 09:02:19 +03:00
David Wertenteil
5ce638572f update path env var 2022-10-02 23:09:24 +03:00
Cheithanya
4b98490ff9 update cmd functionality added 2022-10-02 23:29:21 +05:30
Cheithanya
6ea18ec75b update cmd functionality added 2022-10-02 23:27:39 +05:30
Ben Hirschberg
56e2ffec5c Add arch diagrams (#857)
* Publishing community meetings

* Adding architecture diagrams

* fix type

* resize diagrams

* Changing the operator diagram

Co-authored-by: Benyamin Hirschberg <59160382+BenHirschbergCa@users.noreply.github.com>
2022-10-02 20:36:59 +03:00
David Wertenteil
fa204a208a Merge branch 'dev' 2022-10-02 20:32:09 +03:00
David Wertenteil
9ab0fc593f Update python build file 2022-10-02 20:27:38 +03:00
Moshe-Rappaport-CA
3b9c454245 Merge remote-tracking branch 'armo/dev' into dev 2022-09-29 18:07:29 +03:00
David Wertenteil
a6fc7a0da0 Update logs (#854)
* change user to ks

* update logs

* host scanner with fixed version
2022-09-29 12:18:05 +03:00
David Wertenteil
53ae57e478 host scanner with fixed version 2022-09-29 11:19:24 +03:00
David Wertenteil
1d3401e3b4 Merge remote-tracking branch 'armosec/dev' 2022-09-29 10:47:27 +03:00
Dipankar Das
634198df06 Addition of Cosign for image signing (#826)
- github action (uncommented)

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
2022-09-29 10:46:55 +03:00
David Wertenteil
cffc3953ea Merge remote-tracking branch 'armosec/dev' 2022-09-29 10:37:09 +03:00
David Wertenteil
ea768602fb update logs 2022-09-29 10:36:27 +03:00
David Wertenteil
b4fc6dddd3 change user to ks 2022-09-29 10:35:54 +03:00
Asutosh Panda
96d90c217e Fix typos, linting errors of markdown file, modify the content to make it more concise (#820) 2022-09-29 09:12:43 +03:00
Zoomhawk
a2f1722455 Correcting Punctuation (#849)
* Correcting Punctuation

* Recorrect
2022-09-29 08:57:53 +03:00
Dipankar Das
400b51df1c Refactoring of Code Base (#853)
* Refactoring of switch to if statement

* Edited the core/pkg/score/score.go

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

* Changes to function comments
* core/pkg/registryadaptors/registryvulnerabilities/interfaces.go

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
2022-09-29 08:57:12 +03:00
David Wertenteil
0f3ce6917e Release (#844)
* Fix issue for scanning list obj

* Fix go mod in httphandler pkg

* Broken links fix in roadmap.md 

Planning, backlog, and wishlist links were not taking to the required section.

* override infoMap only if it's not nil

* improved icon of kubescape in readme

* Support scanning several files

* gramatical improvements

* docs(readme): Star → star

* Fix issues according to review

* Handle with issues  caused by updating opa-utils

* Fix scanning ListObj following reviews

* Update core/pkg/resourcehandler/filesloader.go

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>

* Update completion.go

* Added fixed control input

* update go.mod

* Print chart name log when fail to generate

* Change formatting to %s

* Added resource prioritization information, raw resource will be sent on the result object

* Merging typo fixes from master (#772)

* greetings

* Update aws.sh

simplified the comment

* typo: In the title and h1 element

Their was a typo in index.html file.

* punctuation changes

* docs : added gitpod badge in readme.md

* fixed typos

* ƒ some grammar mistake is corrected inPULL_REQUEST_TEMPLATE.md file

* Updated README.md file

Added link to CONTRIBUTING.md file in a line in README.

* Added link to code of conduct file

I have added link to the code of conduct file and fixed some problems in the Readme file.

* Fixed readme

* Added alpine tag

Adding alpine tag instead of latest and removing repeating commands

* roadmap.md file is modified

* Automatically Close "Typo" labelled Issue

* build.py is modified

* modified PR template

* Fixed some typos in feature_request.md

"." at the end of the headings were missing and all the text were in same line.
Now this gives a clear and concise view of the texts.

* fixed the typo in docs/index.html

Found and fixed typo in the 'alt' attribute of img tag

* Update PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>

* update logger version

* update logger version (#773)

* Fixed: Kubescape fails to authenticate remote private Github repo (#721)

* grammar error fixer in CONTRIBUTING.md

* scanning private git repository is available

* giturl to gitapi

* NO TOKEN error functionality added

* Used GetToken method of giturl.IGitAPPI for auth

Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>

* bump opa-utils to 181

* Option to force enable color output (closes #560) (#767)

* Option to force enable color output (closes #560)

(cherry picked from commit 4f951781ee8dd6bb451ac7d159787f47e4b07379)

* Update go.mod

* update scanner image

* Update host scanner image  (#774)

* update logger version

* update scanner image

* remove windows exe extension

* Remove windows extension build (#775)

* update logger version

* update scanner image

* remove windows exe extension

* commened out prioritization logic

* Edit Junit output (#802)

* Edit Junit output

* Update go sum

* Following review

* update AdoptClusterName

* Print line separator only if some controls failed (#813)

* removed the extra 'download' word from the example (#810)

it was confusing to understand the download command because there was an extra 'download' mentioned

* Prioritization (#815)

* removed commented out code

* Added attack tracks information to prioritization algorithm

* bump opa-utils

* go mod tidy

* go mod tidy

* CR changes

* Issue 613 cluster name (#783)

* added --clusterName flag (#613)

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* update flag name to --cluster-name

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* Per 307 fail on severity counters (#831)

* feat: fail on exceeding severity thresholds (#830)

- Add support for severity counters
- Add support for CLI flags that set severity thresholds
- Terminate Kubescape with an exit code 1 if scan results exceed the
  severity thresholds

* Update opa-utils pkg version

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>

* Fix merge conflict

* typo in .gitignore file (#833)

* remove unsupported installation method

* fixed welcome message

* fixed merge

* fixed attack tracks loading logic

* add flag validation for --account-id (#605) (#793)

* add flag validation for --account-id (#605)

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* add flag validation for --client-id & --secret-key

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* Validation method should be a member function

* Adding unit tests for credentials validate

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
Co-authored-by: David Wertenteil <dwertent@armosec.io>

* Scan Kustomize Directory (#795)

* Scan Kustomize Files

* update 'scam Kustomize Directory' documentation in  Readme.md

* go get

* go get inside httphandler

* SourceTypeKustomizeDirectory

* Added Scan for Kustomization File

Co-authored-by: David Wertenteil <dwertent@armosec.io>

* feat: unify severity threshold into one CLI flag (#838)

* feat: unify severity threshold into one CLI flag

Before this commit, severity threshold flags were separated by severity.
This commit unifies these thresholds into one flag that forces Kubescape
to terminate with an exit code 1 if there was at least one failed
control at the specified severity threshold or above.

* chore: update opa utils version

* chore: update opa-utils in httphandler

* feat: dont enforce severity by default

Previous iteration of supporting the severity threshold enforced it even
if the severity threshold was not explicitly specified.
This change enforces the severity threshold only if it has been
explicitly set.

* refactor: clarify flagValidationFramework func name

This change clarifies the meaning of the function that validates the
scan info for the `scan framework` command.
It achieves this by renaming the `flagValidationFramework` function to
`validateFrameworkScanInfo`.

* Merge branch 'master' into dev

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
Co-authored-by: Moshe-Rappaport-CA <moshep@armosec.io>
Co-authored-by: Moshe Rappaport <89577611+Moshe-Rappaport-CA@users.noreply.github.com>
Co-authored-by: Om Raut <33827410+om2137@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
Co-authored-by: Chirag Arora <84070677+Chirag8023@users.noreply.github.com>
Co-authored-by: shm12 <shmuelb@armosec.io>
Co-authored-by: Amir Malka <amirm@armosec.io>
Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>
Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Aditya Pratap Singh <adityapratapsingh51@gmail.com>
Co-authored-by: Ashray Shetty <ashrayshetty1999@gmail.com>
Co-authored-by: Anubhav Gupta <mail.anubhav06@gmail.com>
Co-authored-by: Meyazhagan <meyazhagan.ofcl@gmail.com>
2022-09-29 08:48:09 +03:00
David Wertenteil
11e57fe7ad Merge branch 'master' into dev 2022-09-22 17:34:52 +03:00
David Wertenteil
2ddce8723d Merge branch 'master' into dev 2022-09-22 17:06:44 +03:00
Suhas Gumma
291668647c build killercoda playground added (#843) 2022-09-22 15:59:08 +03:00
Vlad Klokun
d3c41f2492 feat: unify severity threshold into one CLI flag (#838)
* feat: unify severity threshold into one CLI flag

Before this commit, severity threshold flags were separated by severity.
This commit unifies these thresholds into one flag that forces Kubescape
to terminate with an exit code 1 if there was at least one failed
control at the specified severity threshold or above.

* chore: update opa utils version

* chore: update opa-utils in httphandler

* feat: dont enforce severity by default

Previous iteration of supporting the severity threshold enforced it even
if the severity threshold was not explicitly specified.
This change enforces the severity threshold only if it has been
explicitly set.

* refactor: clarify flagValidationFramework func name

This change clarifies the meaning of the function that validates the
scan info for the `scan framework` command.
It achieves this by renaming the `flagValidationFramework` function to
`validateFrameworkScanInfo`.
2022-09-22 15:56:30 +03:00
Avinesh Tripathi
10fa3cb27d Merge branch 'dev' into feature 2022-09-21 23:37:55 +05:30
Avinesh Tripathi
d8f95edff5 removed getLastScanId function 2022-09-21 23:37:08 +05:30
Avinesh Tripathi
37ffe86d8b changed name and added readme 2022-09-21 23:32:16 +05:30
Avinesh Tripathi
87fdbfdcc5 fixed 2022-09-20 18:50:19 +05:30
Cheithanya
424a218860 Added the required changes 2022-09-20 17:09:02 +05:30
Suhas Gumma
faf0ae6bdc Scan Kustomize Directory (#795)
* Scan Kustomize Files

* update 'scam Kustomize Directory' documentation in  Readme.md

* go get

* go get inside httphandler

* SourceTypeKustomizeDirectory

* Added Scan for Kustomization File

Co-authored-by: David Wertenteil <dwertent@armosec.io>
2022-09-20 10:28:50 +03:00
Anubhav Gupta
e46c42554b add flag validation for --account-id (#605) (#793)
* add flag validation for --account-id (#605)

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* add flag validation for --client-id & --secret-key

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* Validation method should be a member function

* Adding unit tests for credentials validate

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
Co-authored-by: David Wertenteil <dwertent@armosec.io>
2022-09-20 10:22:35 +03:00
David Wertenteil
eb16440ba6 Enhancing CLI flags (#835)
* Fix issue for scanning list obj

* Fix go mod in httphandler pkg

* Broken links fix in roadmap.md 

Planning, backlog, and wishlist links were not taking to the required section.

* override infoMap only if it's not nil

* improved icon of kubescape in readme

* Support scanning several files

* gramatical improvements

* docs(readme): Star → star

* Fix issues according to review

* Handle with issues  caused by updating opa-utils

* Fix scanning ListObj following reviews

* Update core/pkg/resourcehandler/filesloader.go

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>

* Update completion.go

* Added fixed control input

* update go.mod

* Print chart name log when fail to generate

* Change formatting to %s

* Added resource prioritization information, raw resource will be sent on the result object

* Merging typo fixes from master (#772)

* greetings

* Update aws.sh

simplified the comment

* typo: In the title and h1 element

Their was a typo in index.html file.

* punctuation changes

* docs : added gitpod badge in readme.md

* fixed typos

* ƒ some grammar mistake is corrected inPULL_REQUEST_TEMPLATE.md file

* Updated README.md file

Added link to CONTRIBUTING.md file in a line in README.

* Added link to code of conduct file

I have added link to the code of conduct file and fixed some problems in the Readme file.

* Fixed readme

* Added alpine tag

Adding alpine tag instead of latest and removing repeating commands

* roadmap.md file is modified

* Automatically Close "Typo" labelled Issue

* build.py is modified

* modified PR template

* Fixed some typos in feature_request.md

"." at the end of the headings were missing and all the text were in same line.
Now this gives a clear and concise view of the texts.

* fixed the typo in docs/index.html

Found and fixed typo in the 'alt' attribute of img tag

* Update PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>

* update logger version

* update logger version (#773)

* Fixed: Kubescape fails to authenticate remote private Github repo (#721)

* grammar error fixer in CONTRIBUTING.md

* scanning private git repository is available

* giturl to gitapi

* NO TOKEN error functionality added

* Used GetToken method of giturl.IGitAPPI for auth

Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>

* bump opa-utils to 181

* Option to force enable color output (closes #560) (#767)

* Option to force enable color output (closes #560)

(cherry picked from commit 4f951781ee8dd6bb451ac7d159787f47e4b07379)

* Update go.mod

* update scanner image

* Update host scanner image  (#774)

* update logger version

* update scanner image

* remove windows exe extension

* Remove windows extension build (#775)

* update logger version

* update scanner image

* remove windows exe extension

* commened out prioritization logic

* Edit Junit output (#802)

* Edit Junit output

* Update go sum

* Following review

* update AdoptClusterName

* Print line separator only if some controls failed (#813)

* removed the extra 'download' word from the example (#810)

it was confusing to understand the download command because there was an extra 'download' mentioned

* Prioritization (#815)

* removed commented out code

* Added attack tracks information to prioritization algorithm

* bump opa-utils

* go mod tidy

* go mod tidy

* CR changes

* Issue 613 cluster name (#783)

* added --clusterName flag (#613)

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* update flag name to --cluster-name

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* Per 307 fail on severity counters (#831)

* feat: fail on exceeding severity thresholds (#830)

- Add support for severity counters
- Add support for CLI flags that set severity thresholds
- Terminate Kubescape with an exit code 1 if scan results exceed the
  severity thresholds

* Update opa-utils pkg version

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>

* Fix merge conflict

* typo in .gitignore file (#833)

* remove unsupported installation method

* fixed welcome message

* fixed merge

* fixed attack tracks loading logic

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
Co-authored-by: Moshe-Rappaport-CA <moshep@armosec.io>
Co-authored-by: Moshe Rappaport <89577611+Moshe-Rappaport-CA@users.noreply.github.com>
Co-authored-by: Om Raut <33827410+om2137@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
Co-authored-by: Chirag Arora <84070677+Chirag8023@users.noreply.github.com>
Co-authored-by: shm12 <shmuelb@armosec.io>
Co-authored-by: Amir Malka <amirm@armosec.io>
Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>
Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Aditya Pratap Singh <adityapratapsingh51@gmail.com>
Co-authored-by: Ashray Shetty <ashrayshetty1999@gmail.com>
Co-authored-by: Anubhav Gupta <mail.anubhav06@gmail.com>
Co-authored-by: Meyazhagan <meyazhagan.ofcl@gmail.com>
2022-09-19 08:41:40 +03:00
Cheithanya
12f81353e0 Made the required changes 2022-09-19 00:30:26 +05:30
Amir Malka
fd33a8acd1 fixed attack tracks loading logic 2022-09-18 17:48:13 +03:00
David Wertenteil
374e268a4f fixed merge 2022-09-18 17:26:29 +03:00
David Wertenteil
405bfbf9ba Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2022-09-18 16:59:22 +03:00
David Wertenteil
304227200f fixed welcome message 2022-09-18 16:59:08 +03:00
David Wertenteil
dc10125380 Merge branch 'master' into dev 2022-09-18 15:48:48 +03:00
David Wertenteil
51c417ebc3 Merge branch 'master' of https://github.com/kubescape/kubescape 2022-09-18 15:37:52 +03:00
David Wertenteil
862230f58a Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2022-09-18 13:44:52 +03:00
David Wertenteil
6416fc56d7 remove unsupported installation method 2022-09-18 13:44:45 +03:00
Rutvikk :D
a8ad8e5f5a Update README.md (#827) 2022-09-18 13:33:07 +03:00
Meyazhagan
d5edf29554 typo in .gitignore file (#833) 2022-09-18 13:32:17 +03:00
David Wertenteil
4351099e79 Fix merge conflict 2022-09-18 11:41:28 +03:00
David Wertenteil
196d07edc6 Per 307 fail on severity counters (#831)
* feat: fail on exceeding severity thresholds (#830)

- Add support for severity counters
- Add support for CLI flags that set severity thresholds
- Terminate Kubescape with an exit code 1 if scan results exceed the
  severity thresholds

* Update opa-utils pkg version

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
2022-09-18 10:34:34 +03:00
Anubhav Gupta
f4bb03039a Issue 613 cluster name (#783)
* added --clusterName flag (#613)

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

* update flag name to --cluster-name

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>

Signed-off-by: Anubhav Gupta <mail.anubhav06@gmail.com>
2022-09-18 10:27:52 +03:00
Avinesh Tripathi
d6427f0fc8 Merge branch 'dev' into feature 2022-09-16 10:34:51 +05:30
Avinesh Tripathi
f33a6d7634 added adaptor 2022-09-16 10:20:44 +05:30
Amir Malka
2b931fb3f0 Prioritization (#815)
* removed commented out code

* Added attack tracks information to prioritization algorithm

* bump opa-utils

* go mod tidy

* go mod tidy

* CR changes
2022-09-15 16:16:54 +03:00
Arvindh
bb586892ba Fixed typos on multiple files (#808) 2022-09-15 15:53:32 +03:00
Ashray Shetty
cb18f60f82 removed the extra 'download' word from the example (#810)
it was confusing to understand the download command because there was an extra 'download' mentioned
2022-09-15 15:48:11 +03:00
Moshe Rappaport
e5023943e5 Print line separator only if some controls failed (#813) 2022-09-15 15:47:39 +03:00
Amir Malka
c565dc5af7 Merge pull request #816 from dwertent/master
Fix cluster name adoption
2022-09-15 15:40:14 +03:00
David Wertenteil
5634903aa0 update AdoptClusterName 2022-09-15 14:53:55 +03:00
David Wertenteil
ce81a9cb22 Merge remote-tracking branch 'armosec/dev' 2022-09-15 14:14:27 +03:00
Moshe-Rappaport-CA
5a01a1a30a Print line separator only if some controls failed 2022-09-14 19:22:08 +03:00
Moshe Rappaport
cb704cb1e7 Edit Junit output (#802)
* Edit Junit output

* Update go sum

* Following review
2022-09-14 08:59:39 +03:00
Jatin Agarwal
6e2dda7993 Fixed typos in roadmap.md (#800) 2022-09-13 10:39:28 +03:00
itsCheithanya
15e1d6d1a2 Update README.md (#804)
* Update README.md

* Create kubeconfig

* Delete kubeconfig

* Create kubeconfig

* Rename kubeconfig to kubeconfig.go

* Delete kubeconfig.go

* Update root.go

* Update rootinfo.go

* Added the update command for kubescape

* auto pick the OS of the usersystem

* added the html format desc

* a branch without update command added

* rolled back to prev

* added the html format documentation
2022-09-13 10:23:04 +03:00
Cheithanya
ba588b9eef Added the comments for update command 2022-09-12 21:28:55 +05:30
Cheithanya
f48b848eb6 auto pick the OS of the usersystem 2022-09-11 23:48:14 +05:30
Cheithanya
f81fd74aa3 Added the update command for kubescape 2022-09-11 18:22:18 +05:30
itsCheithanya
ad608b08e0 Merge branch 'kubescape:master' into master 2022-09-07 14:24:55 +05:30
itsCheithanya
f9e80b709a Update rootinfo.go 2022-09-07 13:42:35 +05:30
itsCheithanya
f75b62e62c Update root.go 2022-09-07 13:39:29 +05:30
itsCheithanya
1c24a55d4b Delete kubeconfig.go 2022-09-07 13:37:32 +05:30
Vicky Aryan
43dbb55d50 fixed some typo mistakes (#786) 2022-09-07 11:01:21 +03:00
Vicky Aryan
6ec974f996 Merge branch 'kubescape:master' into master 2022-09-06 20:39:21 +05:30
itsCheithanya
03418299b8 Rename kubeconfig to kubeconfig.go 2022-09-06 18:32:27 +05:30
itsCheithanya
f5bd86593c Create kubeconfig 2022-09-06 18:32:00 +05:30
itsCheithanya
2af78eaab2 Delete kubeconfig 2022-09-06 18:30:16 +05:30
itsCheithanya
67cd003afe Create kubeconfig 2022-09-06 18:18:08 +05:30
Krishna Agarwal
f7f11abfc2 fixed typos (#777)
* fixed typos

* Update container-image-vulnerability-adaptor.md
2022-09-06 09:41:18 +03:00
TarangVerma
52aa5f02e2 Fixed typos in contribute.md (#779)
Fixed some spellings as well as grammar so that reader gets clear and concise view of the text.
2022-09-06 09:40:47 +03:00
itsCheithanya
ce8175be61 Update README.md (#782) 2022-09-06 09:39:25 +03:00
itsCheithanya
0bc542f851 Update README.md 2022-09-05 22:23:40 +05:30
Ben Hirschberg
8e4f88ce5b Publishing community meetings (#781) 2022-09-05 19:41:19 +03:00
David Wertenteil
d1c759f04f Hot fix - Revert report structure (#776)
* Fix issue for scanning list obj

* Fix go mod in httphandler pkg

* Broken links fix in roadmap.md 

Planning, backlog, and wishlist links were not taking to the required section.

* override infoMap only if it's not nil

* improved icon of kubescape in readme

* Support scanning several files

* gramatical improvements

* docs(readme): Star → star

* Fix issues according to review

* Handle with issues  caused by updating opa-utils

* Fix scanning ListObj following reviews

* Update core/pkg/resourcehandler/filesloader.go

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>

* Update completion.go

* Added fixed control input

* update go.mod

* Print chart name log when fail to generate

* Change formatting to %s

* Added resource prioritization information, raw resource will be sent on the result object

* Merging typo fixes from master (#772)

* greetings

* Update aws.sh

simplified the comment

* typo: In the title and h1 element

Their was a typo in index.html file.

* punctuation changes

* docs : added gitpod badge in readme.md

* fixed typos

* ƒ some grammar mistake is corrected inPULL_REQUEST_TEMPLATE.md file

* Updated README.md file

Added link to CONTRIBUTING.md file in a line in README.

* Added link to code of conduct file

I have added link to the code of conduct file and fixed some problems in the Readme file.

* Fixed readme

* Added alpine tag

Adding alpine tag instead of latest and removing repeating commands

* roadmap.md file is modified

* Automatically Close "Typo" labelled Issue

* build.py is modified

* modified PR template

* Fixed some typos in feature_request.md

"." at the end of the headings were missing and all the text were in same line.
Now this gives a clear and concise view of the texts.

* fixed the typo in docs/index.html

Found and fixed typo in the 'alt' attribute of img tag

* Update PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>

* update logger version (#773)

* Fixed: Kubescape fails to authenticate remote private Github repo (#721)

* grammar error fixer in CONTRIBUTING.md

* scanning private git repository is available

* giturl to gitapi

* NO TOKEN error functionality added

* Used GetToken method of giturl.IGitAPPI for auth

Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>

* bump opa-utils to 181

* Option to force enable color output (closes #560) (#767)

* Option to force enable color output (closes #560)

(cherry picked from commit 4f951781ee8dd6bb451ac7d159787f47e4b07379)

* Update go.mod

* Update host scanner image  (#774)

* update logger version

* update scanner image

* Remove windows extension build (#775)

* update logger version

* update scanner image

* remove windows exe extension

* commened out prioritization logic

Co-authored-by: Moshe-Rappaport-CA <moshep@armosec.io>
Co-authored-by: Moshe Rappaport <89577611+Moshe-Rappaport-CA@users.noreply.github.com>
Co-authored-by: Om Raut <33827410+om2137@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
Co-authored-by: Chirag Arora <84070677+Chirag8023@users.noreply.github.com>
Co-authored-by: shm12 <shmuelb@armosec.io>
Co-authored-by: Amir Malka <amirm@armosec.io>
Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>
Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Aditya Pratap Singh <adityapratapsingh51@gmail.com>
2022-09-05 12:08:19 +03:00
David Wertenteil
362ea83549 Merge branch 'dev' of https://github.com/kubescape/kubescape into dev 2022-09-05 11:50:40 +03:00
David Wertenteil
4cb7b999ad Merge branch 'master' into dev 2022-09-05 11:49:05 +03:00
Amir Malka
81482b7421 commened out prioritization logic 2022-09-05 11:46:59 +03:00
David Wertenteil
2b7807f300 Merge branch 'master' of https://github.com/kubescape/kubescape 2022-09-05 11:46:21 +03:00
David Wertenteil
ef23d022ee Merge remote-tracking branch 'armosec/dev' 2022-09-05 11:44:53 +03:00
David Wertenteil
02d7fdc4f9 Remove windows extension build (#775)
* update logger version

* update scanner image

* remove windows exe extension
2022-09-05 11:37:56 +03:00
David Wertenteil
ccb3351607 remove windows exe extension 2022-09-05 11:35:08 +03:00
David Wertenteil
72f9c6d81b Fixed InfoMap usage (#680)
* Fix issue for scanning list obj

* Fix go mod in httphandler pkg

* Broken links fix in roadmap.md 

Planning, backlog, and wishlist links were not taking to the required section.

* override infoMap only if it's not nil

* improved icon of kubescape in readme

* Support scanning several files

* gramatical improvements

* docs(readme): Star → star

* Fix issues according to review

* Handle with issues  caused by updating opa-utils

* Fix scanning ListObj following reviews

* Update core/pkg/resourcehandler/filesloader.go

Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>

* Update completion.go

* Added fixed control input

* update go.mod

* Print chart name log when fail to generate

* Change formatting to %s

* Added resource prioritization information, raw resource will be sent on the result object

* Merging typo fixes from master (#772)

* greetings

* Update aws.sh

simplified the comment

* typo: In the title and h1 element

Their was a typo in index.html file.

* punctuation changes

* docs : added gitpod badge in readme.md

* fixed typos

* ƒ some grammar mistake is corrected inPULL_REQUEST_TEMPLATE.md file

* Updated README.md file

Added link to CONTRIBUTING.md file in a line in README.

* Added link to code of conduct file

I have added link to the code of conduct file and fixed some problems in the Readme file.

* Fixed readme

* Added alpine tag

Adding alpine tag instead of latest and removing repeating commands

* roadmap.md file is modified

* Automatically Close "Typo" labelled Issue

* build.py is modified

* modified PR template

* Fixed some typos in feature_request.md

"." at the end of the headings were missing and all the text were in same line.
Now this gives a clear and concise view of the texts.

* fixed the typo in docs/index.html

Found and fixed typo in the 'alt' attribute of img tag

* Update PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>

* update logger version (#773)

* Fixed: Kubescape fails to authenticate remote private Github repo (#721)

* grammar error fixer in CONTRIBUTING.md

* scanning private git repository is available

* giturl to gitapi

* NO TOKEN error functionality added

* Used GetToken method of giturl.IGitAPPI for auth

Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>

* bump opa-utils to 181

* Option to force enable color output (closes #560) (#767)

* Option to force enable color output (closes #560)

(cherry picked from commit 4f951781ee8dd6bb451ac7d159787f47e4b07379)

* Update go.mod

* Update host scanner image  (#774)

* update logger version

* update scanner image

Co-authored-by: Moshe-Rappaport-CA <moshep@armosec.io>
Co-authored-by: Moshe Rappaport <89577611+Moshe-Rappaport-CA@users.noreply.github.com>
Co-authored-by: Om Raut <33827410+om2137@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
Co-authored-by: Chirag Arora <84070677+Chirag8023@users.noreply.github.com>
Co-authored-by: shm12 <shmuelb@armosec.io>
Co-authored-by: Amir Malka <amirm@armosec.io>
Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>
Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Aditya Pratap Singh <adityapratapsingh51@gmail.com>
2022-09-05 10:49:37 +03:00
David Wertenteil
bba70b4c46 Update host scanner image (#774)
* update logger version

* update scanner image
2022-09-05 10:15:56 +03:00
David Wertenteil
46073e0a6c update scanner image 2022-09-05 10:12:28 +03:00
David Wertenteil
93a44f494d Merge remote-tracking branch 'armosec/dev' 2022-09-05 09:33:59 +03:00
Aditya Pratap Singh
5c96f877ed Option to force enable color output (closes #560) (#767)
* Option to force enable color output (closes #560)

(cherry picked from commit 4f951781ee8dd6bb451ac7d159787f47e4b07379)

* Update go.mod
2022-09-05 09:03:38 +03:00
Amir Malka
23ea7e0511 bump opa-utils to 181 2022-09-04 15:32:42 +03:00
Suhas Gumma
137b3d7b5d Fixed: Kubescape fails to authenticate remote private Github repo (#721)
* grammar error fixer in CONTRIBUTING.md

* scanning private git repository is available

* giturl to gitapi

* NO TOKEN error functionality added

* Used GetToken method of giturl.IGitAPPI for auth

Co-authored-by: satyam kale <satyamkale271@gmail.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
2022-09-04 15:17:15 +03:00
David Wertenteil
13ffd92210 update logger version (#773) 2022-09-04 15:13:16 +03:00
David Wertenteil
4725f8b3ca update logger version 2022-09-04 15:02:04 +03:00
David Wertenteil
6d65a90de9 Merging typo fixes from master (#772)
* greetings

* Update aws.sh

simplified the comment

* typo: In the title and h1 element

Their was a typo in index.html file.

* punctuation changes

* docs : added gitpod badge in readme.md

* fixed typos

* ƒ some grammar mistake is corrected inPULL_REQUEST_TEMPLATE.md file

* Updated README.md file

Added link to CONTRIBUTING.md file in a line in README.

* Added link to code of conduct file

I have added link to the code of conduct file and fixed some problems in the Readme file.

* Fixed readme

* Added alpine tag

Adding alpine tag instead of latest and removing repeating commands

* roadmap.md file is modified

* Automatically Close "Typo" labelled Issue

* build.py is modified

* modified PR template

* Fixed some typos in feature_request.md

"." at the end of the headings were missing and all the text were in same line.
Now this gives a clear and concise view of the texts.

* fixed the typo in docs/index.html

Found and fixed typo in the 'alt' attribute of img tag

* Update PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krishna Agarwal <dmkrishna.agarwal@gmail.com>
Co-authored-by: Saswata Senapati <74651639+saswat16@users.noreply.github.com>
Co-authored-by: Rahul Singh <110548934+rahuldhirendersingh@users.noreply.github.com>
Co-authored-by: deepuyadav004 <deepuyadavze@gmail.com>
Co-authored-by: kartik <97971066+kartikgajjar7@users.noreply.github.com>
Co-authored-by: Rounak-28 <95576871+Rounak-28@users.noreply.github.com>
Co-authored-by: pwnb0y <vickykr07@yahoo.com>
Co-authored-by: Ben Hirschberg <59160382+slashben@users.noreply.github.com>
Co-authored-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: Rahul Surwade <93492791+RahulSurwade08@users.noreply.github.com>
Co-authored-by: Suhas Gumma <43647369+suhasgumma@users.noreply.github.com>
Co-authored-by: Kamal Nayan <95926324+legendarykamal@users.noreply.github.com>
Co-authored-by: TarangVerma <90996971+TarangVerma@users.noreply.github.com>
Co-authored-by: avikittu <65793296+avikittu@users.noreply.github.com>
2022-09-04 14:50:22 +03:00
David Wertenteil
faf928527d Merge pull request #770 from amirmalka/dev
Resources Prioritization
2022-09-04 14:17:19 +03:00
Amir Malka
18c6e80c3c Added resource prioritization information, raw resource will be sent on the result object 2022-09-04 13:38:48 +03:00
David Wertenteil
83045c743a Merge pull request #748 from RahulSurwade08/master
Updated Dockerfile
2022-09-04 13:05:39 +03:00
David Wertenteil
4940912784 Merge pull request #750 from pwnb0y/doc-1
roadmap.md file is modified
2022-09-04 13:03:24 +03:00
David Wertenteil
a7fd2bd058 Merge pull request #724 from Rounak-28/patch-2
fixed typos
2022-09-04 13:02:51 +03:00
David Wertenteil
aa1f61a4f8 Merge pull request #755 from suhasgumma/workflow
Fixed: Misconfiguration in "close-typos-issues.yaml" GITHUB Actions file
2022-09-04 13:00:57 +03:00
David Wertenteil
b103e817ed Merge pull request #745 from Moshe-Rappaport-CA/dev
Print chart name log when fail to generate
2022-09-04 12:59:30 +03:00
David Wertenteil
55045badce Merge pull request #764 from legendarykamal/patch-1
Modified PR template
2022-09-04 12:58:05 +03:00
David Wertenteil
e951e23bc4 Update PULL_REQUEST_TEMPLATE.md 2022-09-04 12:57:49 +03:00
David Wertenteil
d467f159ad Merge pull request #759 from pwnb0y/python-patch1
build.py is modified
2022-09-04 12:55:39 +03:00
David Wertenteil
bb2a7b8d6c Merge pull request #766 from TarangVerma/patch-1
Fixed some typos in feature_request.md
2022-09-04 12:48:17 +03:00
David Wertenteil
23bb8ec482 Merge pull request #769 from avikittu/patch-1
fixed the typo in docs/index.html
2022-09-04 12:43:07 +03:00
avikittu
6c50fe1011 fixed the typo in docs/index.html
Found and fixed typo in the 'alt' attribute of img tag
2022-09-04 14:17:09 +05:30
TarangVerma
4268cb31c3 Fixed some typos in feature_request.md
"." at the end of the headings were missing and all the text were in same line.
Now this gives a clear and concise view of the texts.
2022-09-04 09:39:15 +05:30
Kamal Nayan
3b37d56427 modified PR template 2022-09-03 14:29:13 +05:30
pwnb0y
f239075c26 build.py is modified 2022-09-02 20:25:16 +00:00
Suhas Gumma
b0c8c42c85 Automatically Close "Typo" labelled Issue 2022-09-02 15:23:41 +05:30
pwnb0y
ea777b67ec roadmap.md file is modified 2022-09-01 10:45:14 -04:00
Vicky Aryan
ebf1486a7d Merge branch 'kubescape:master' into master 2022-09-01 17:53:52 +05:30
Moshe Rappaport
2db2f55d16 Change formatting to %s 2022-09-01 14:28:18 +03:00
David Wertenteil
cf9f34c0be Merge pull request #705 from deepuyadav004/dcs
punctuation changes
2022-09-01 09:04:09 +03:00
David Wertenteil
4d4bec95f2 Merge pull request #679 from saswat16/patch-2
Update aws.sh
2022-09-01 08:57:53 +03:00
David Wertenteil
f3a5ce75d5 Merge pull request #732 from pwnb0y/docs
grammatical mistake is corrected in PULL_REQUEST_TEMPLATE.md file
2022-09-01 08:47:09 +03:00
David Wertenteil
b38ce5e812 Merge pull request #734 from Chirag8023/patch-3
Patch 3
2022-09-01 08:44:26 +03:00
David Wertenteil
e4733fa02c Merge pull request #746 from SaptarshiSarkar12/patch-3
Updated README.md file
2022-09-01 08:43:12 +03:00
David Wertenteil
39ea443f81 Merge pull request #709 from kartikgajjar7/patch-2
docs : added gitpod badge in readme.md
2022-09-01 08:42:05 +03:00
David Wertenteil
d03806aea2 Merge pull request #738 from shm12/dev
Adding fixed control input
2022-09-01 08:32:26 +03:00
Rahul Surwade
576c281150 Added alpine tag
Adding alpine tag instead of latest and removing repeating commands
2022-08-31 17:16:31 -04:00
Saptarshi Sarkar
dfabcd691a Fixed readme 2022-09-01 00:03:15 +05:30
Saptarshi Sarkar
e2698e71a3 Added link to code of conduct file
I have added link to the code of conduct file and fixed some problems in the Readme file.
2022-08-31 23:47:56 +05:30
Saptarshi Sarkar
6901628b5a Updated README.md file
Added link to CONTRIBUTING.md file in a line in README.
2022-08-31 23:39:39 +05:30
Moshe-Rappaport-CA
fc3912ca7d Print chart name log when fail to generate 2022-08-31 15:26:24 +03:00
Ben Hirschberg
c83cb4496d Merge pull request #687 from rahuldhirendersingh/patch-2
typo: In the title and h1 element
2022-08-30 13:28:27 +03:00
shm12
a76228c1e1 update go.mod 2022-08-30 11:39:54 +03:00
shm12
9447f2933a Added fixed control input 2022-08-30 11:33:19 +03:00
David Wertenteil
26d4664cc5 Merge pull request #694 from Moshe-Rappaport-CA/support-scanning-several-files
Support scanning several files
2022-08-30 10:01:44 +03:00
Ben Hirschberg
05fa9d887d Merge pull request #672 from MrKrishnaAgarwal/patch-2
greetings
2022-08-30 08:03:28 +03:00
Chirag Arora
acdad028a3 Update completion.go 2022-08-30 00:59:00 +05:30
pwnb0y
890ababe0a ƒ some grammar mistake is corrected inPULL_REQUEST_TEMPLATE.md file 2022-08-30 00:28:49 +05:30
Moshe Rappaport
de78615038 Update core/pkg/resourcehandler/filesloader.go
Co-authored-by: Vlad Klokun <vladklokun@users.noreply.github.com>
2022-08-29 18:10:21 +03:00
Rounak-28
db35670432 fixed typos 2022-08-29 18:33:35 +05:30
Vicky Aryan
4d954b2ab0 Merge branch 'kubescape:master' into master 2022-08-29 17:29:26 +05:30
David Wertenteil
1c215c36af Merge pull request #682 from MaruthiKo/patch-1
Fixed Typos in examples/exceptions/README.md
2022-08-29 14:53:49 +03:00
David Wertenteil
2e8f64b20a Merge pull request #675 from MrKrishnaAgarwal/patch-3
fix typos
2022-08-29 14:53:16 +03:00
Moshe-Rappaport-CA
9c764c90e3 Fix scanning ListObj following reviews 2022-08-29 10:29:25 +03:00
Moshe-Rappaport-CA
95a4c19dc6 Handle with issues caused by updating opa-utils 2022-08-29 10:17:31 +03:00
pwnb0y
4d155a6b4f install.ps1 is modified 2022-08-29 11:25:29 +05:30
Moshe-Rappaport-CA
e3352f90e1 Merge remote-tracking branch 'armo/dev' into support-scanning-several-files 2022-08-28 12:03:09 +03:00
Moshe-Rappaport-CA
677a9da80a Fix issues according to review 2022-08-28 12:02:21 +03:00
Krishna Agarwal
83e53c09eb Merge branch 'kubescape:master' into patch-2 2022-08-28 12:37:37 +05:30
Ben Hirschberg
c7e1e251ba Merge pull request #693 from satyamkale27/Gramma-Mistakes
grammar error fixer in CONTRIBUTING.md
2022-08-28 09:41:03 +03:00
kartik
aff7af5159 docs : added gitpod badge in readme.md 2022-08-27 16:56:44 +05:30
deepuyadav004
7bd77d666d punctuation changes 2022-08-26 23:05:30 +05:30
Vlad Klokun
9a7eb4b9a5 Merge pull request #690 from legendarykamal/master
docs: center the icon, reword starring call to action
2022-08-26 14:47:24 +03:00
Vlad Klokun
903b5f39df docs(readme): Star → star 2022-08-25 23:00:10 +03:00
Kamal Nayan
55f0ca3e9e gramatical improvements 2022-08-26 00:57:56 +05:30
David Wertenteil
3387e677ba Merge pull request #636 from Moshe-Rappaport-CA/dev
Fix scanning list obj
2022-08-25 17:33:38 +03:00
Moshe-Rappaport-CA
5774acfc81 Merge remote-tracking branch 'armo/dev' into support-scanning-several-files 2022-08-25 15:25:58 +03:00
Moshe-Rappaport-CA
0eee2d1d0a Support scanning several files 2022-08-25 15:20:26 +03:00
satyam kale
0c624cc576 grammar error fixer in CONTRIBUTING.md 2022-08-25 15:21:51 +05:30
Kamal Nayan
aade1008c4 improved icon of kubescape in readme 2022-08-25 14:54:03 +05:30
Rahul Singh
c58b099230 typo: In the title and h1 element
Their was a typo in index.html file.
2022-08-25 02:57:31 +05:30
Konjeti Maruthi
786092bdaf Fixed Typos in examples/exceptions/README.md
Fixed a few typos and grammatical mistakes in the readme.md
2022-08-24 22:12:57 +05:30
David Wertenteil
80adf03926 Merge branch 'master' into dev 2022-08-24 17:23:28 +03:00
David Wertenteil
4b9c35d53b Merge branch 'master' of https://github.com/kubescape/kubescape 2022-08-24 17:23:10 +03:00
David Wertenteil
f3623dccf6 Merge pull request #678 from RohitYandigeri/patch-5
Update container-image-vulnerability-adaptor.md

Resolves #673
2022-08-24 17:20:28 +03:00
Saswata Senapati
b0db1e3d40 Update aws.sh
simplified the comment
2022-08-24 19:41:40 +05:30
David Wertenteil
b936c3f857 Merge branch 'master' into dev 2022-08-24 17:11:38 +03:00
David Wertenteil
600b9a6fb0 Merge branch 'master' of https://github.com/kubescape/kubescape 2022-08-24 17:11:13 +03:00
David Wertenteil
3bec2ef0b7 override infoMap only if it's not nil 2022-08-24 17:10:18 +03:00
Rohit Yandigeri
3d8344f23c Update container-image-vulnerability-adaptor.md 2022-08-24 19:07:54 +05:30
Krishna Agarwal
d87836d0a9 fix typos 2022-08-24 18:25:06 +05:30
Krishna Agarwal
42908ceb6f greetings 2022-08-24 18:15:00 +05:30
David Wertenteil
70288c94c3 Merge pull request #665 from rahuldhirendersingh/patch-1
Fixed typo: for better code readability
2022-08-24 15:39:24 +03:00
David Wertenteil
2bc63c2ab6 Merge pull request #659 from RohitYandigeri/patch-4
Update README.md
2022-08-24 15:35:21 +03:00
David Wertenteil
609cbff2da Merge pull request #655 from om2137/om2
Broken links fix in roadmap.md
2022-08-24 15:29:50 +03:00
David Wertenteil
3cf0931fb8 Merge pull request #652 from Polokghosh53/patch-2
Update CONTRIBUTING.md
2022-08-24 15:28:46 +03:00
David Wertenteil
a42d2452fd Merge branch 'master' into patch-2 2022-08-24 15:28:32 +03:00
David Wertenteil
7dd79874cc Merge pull request #645 from Hirdey-1999/patch-2
Updated roadmap.md : Typo Error
2022-08-24 15:21:50 +03:00
David Wertenteil
d1a75f076e Merge pull request #640 from Yh010/patch-3
Corrected grammatical errors
2022-08-24 15:20:42 +03:00
David Wertenteil
08fa833f82 Merge branch 'master' into patch-3 2022-08-24 15:20:34 +03:00
David Wertenteil
45e869e0d6 Merge pull request #634 from asim-bhatta/document
Edited few words
2022-08-24 15:15:28 +03:00
David Wertenteil
46cfc882c2 Merge pull request #667 from dwertent/master
Adding close `typo` issues workflow
2022-08-24 14:40:16 +03:00
Ben Hirschberg
10583a4b9b Merge pull request #661 from slashben/master
Updates to roadmap and readme
2022-08-24 14:12:47 +03:00
Ben Hirschberg
da2adf3059 Update close-typos-issues.yaml 2022-08-24 14:01:43 +03:00
David Wertenteil
da24c9164a auto close typo issues 2022-08-24 13:27:24 +03:00
Rahul Singh
8ac41533b6 typo correction: for better code readability
There was some spelling mistakes at multiple places, so I've made those changes to increase the better code readability
2022-08-24 14:07:49 +05:30
David Wertenteil
76958f285c Merge branch 'master' into master 2022-08-24 11:06:05 +03:00
David Wertenteil
93f6f3aecf Update README.md 2022-08-24 11:04:17 +03:00
Benyamin Hirschberg
971f0c06e7 Adding "open for contribution" tickets in the team intro section 2022-08-24 09:36:12 +03:00
Benyamin Hirschberg
bd4e0483d4 small reame changes 2022-08-24 09:31:16 +03:00
Ben Hirschberg
838eff3037 Merge pull request #637 from kubescape/dev
Replacing `armosec` by `kubescape`
2022-08-24 09:28:09 +03:00
Benyamin Hirschberg
1ee1c11700 removing ARMO from Kubescape logo 2022-08-24 09:15:33 +03:00
Benyamin Hirschberg
daa6db164a Updating high level roadmap 2022-08-24 09:11:01 +03:00
Rohit Yandigeri
eb33542e4a Update README.md 2022-08-24 10:40:48 +05:30
Om Raut
a03b0c94c4 Broken links fix in roadmap.md
Planning, backlog, and wishlist links were not taking to the required section.
2022-08-24 02:18:56 +05:30
David Wertenteil
402aea1493 Merge remote-tracking branch 'armosec/dev' 2022-08-23 22:34:03 +03:00
David Wertenteil
26c0baefe7 Fixing building section links 2022-08-23 22:33:04 +03:00
David Wertenteil
057d22adc1 Merge branch 'master' into dev 2022-08-23 22:29:24 +03:00
Polok-Ghosh
77f3806abf Update CONTRIBUTING.md
Some minute changes in the contributing.md
2022-08-24 00:38:31 +05:30
David Wertenteil
5f6689adc1 Merge pull request #651 from dwertent/master
Fixed links in readme
2022-08-23 21:48:31 +03:00
David Wertenteil
051ec71263 Merge remote-tracking branch 'armosec/dev' 2022-08-23 21:43:43 +03:00
David Wertenteil
c3434814c1 Fixed readme links 2022-08-23 21:43:02 +03:00
Hirdey-1999
38325c5af4 Update roadmap.md 2022-08-23 21:33:05 +05:30
Moshe-Rappaport-CA
589d0545cb Merge branch 'dev' of github.com:Moshe-Rappaport-CA/kubescape into dev 2022-08-23 17:41:01 +03:00
Moshe-Rappaport-CA
32b74608bf Merge remote-tracking branch 'armo/dev' into dev 2022-08-23 17:02:15 +03:00
Yash Hegde
98c0be147b Corrected grammatical errors 2022-08-23 19:07:36 +05:30
David Wertenteil
6442e8c891 fixed test deps pkg 2022-08-23 16:31:19 +03:00
Moshe-Rappaport-CA
9454924b9f Merge remote-tracking branch 'armo/dev' into dev 2022-08-23 16:11:07 +03:00
Moshe Rappaport
7233f00c32 Merge branch 'dev' into dev 2022-08-23 15:51:57 +03:00
Moshe-Rappaport-CA
905db42625 Fix go mod in httphandler pkg 2022-08-23 15:49:06 +03:00
David Wertenteil
40e02899bb Merge pull request #604 from kubescape/send-num-of-resources
Send num of resources
2022-08-23 15:26:23 +03:00
Asim Bhatta
bfdf24afb4 Edited few words 2022-08-23 18:02:38 +05:45
Asim Bhatta
588269f1a0 Merge branch 'document' of https://github.com/asim-bhatta/kubescape into document 2022-08-23 17:57:38 +05:45
David Wertenteil
040b965be2 Merge pull request #633 from dwertent/master
Replacing `armo` organization by `kubescape` organization
2022-08-23 15:10:16 +03:00
Daniel-GrunbergerCA
363951eb94 pr fixes 2022-08-23 15:07:51 +03:00
Asim Bhatta
a45283b128 Edited here as well 2022-08-23 17:39:43 +05:45
Moshe-Rappaport-CA
05d5ad47f2 Merge remote-tracking branch 'armo/dev' into dev 2022-08-23 14:42:38 +03:00
Moshe-Rappaport-CA
5ccb858d7f Fix issue for scanning list obj 2022-08-23 14:42:12 +03:00
Asim Bhatta
c49c808730 Merge branch 'kubescape:master' into document 2022-08-23 17:16:59 +05:45
Asim Bhatta
23d44aef7e Edited few words 2022-08-23 16:22:06 +05:45
David Wertenteil
657beea858 Merge pull request #632 from SaptarshiSarkar12/patch-2
Fixed typo
2022-08-23 13:29:06 +03:00
David Wertenteil
4becfc6b88 Update PULL_REQUEST_TEMPLATE.md 2022-08-23 13:28:40 +03:00
Saptarshi Sarkar
b2763b1f4f Fixed typo 2022-08-23 15:54:22 +05:30
David Wertenteil
cbd4fc1a80 replace armo by kubescape mentioned in urls 2022-08-23 12:33:48 +03:00
David Wertenteil
6a17eb1e86 Merge pull request #631 from slashben/dev
Removing mention of ARMO in the initi log print
2022-08-23 12:29:38 +03:00
Ben Hirschberg
4e847b4293 Removing mention of ARMO in the initi log print 2022-08-23 11:25:28 +03:00
Daniel-GrunbergerCA
e81d8ffa3c use setters 2022-08-23 10:34:05 +03:00
David Wertenteil
2e1de8a48f Merge pull request #622 from OmAximani0/pr-template
Added simple PR template
2022-08-23 08:29:10 +03:00
David Wertenteil
240971172d Requesting PRs should be opened against the dev branch 2022-08-23 08:28:04 +03:00
David Wertenteil
1b54f3b87c Merge pull request #628 from rakshitgondwal/changes
Update README.md
2022-08-23 08:21:10 +03:00
David Wertenteil
cf6ae51f76 Update README.md 2022-08-23 08:20:15 +03:00
David Wertenteil
12619f4f3b Update README.md 2022-08-23 08:19:01 +03:00
Rakshit Gondwal
4b96ce4a54 Update README.md 2022-08-23 02:36:21 +05:30
David Wertenteil
86c1f57128 Merge pull request #626 from Yh010/patch-2
Correction of grammatical errors
2022-08-22 23:47:17 +03:00
Yash Hegde
7a51b46178 Correction of grammatical errors 2022-08-23 00:29:18 +05:30
OmAxiani0
eeb1d8bff7 Added simple PR template 2022-08-22 22:05:43 +05:30
David Wertenteil
04f757913a Merge pull request #616 from NirmitSawant/patch-2
Updated the correct link on the discord button
2022-08-22 19:18:55 +03:00
NirmitSawant
307b7be28d Updated the correct link on the discord button 2022-08-22 21:06:26 +05:30
David Wertenteil
c3d188bde4 Merge pull request #615 from prajapatiomkar/master
Made changes in README file by adding discord link correctly
2022-08-22 18:27:09 +03:00
Prajapati omkar
52c2b4e854 Made changes in Readme file by adding discord link 2022-08-22 20:53:31 +05:30
David Wertenteil
bd970eff83 update to kubescape org 2022-08-22 18:22:28 +03:00
David Wertenteil
7bba5fafe0 Merge pull request #607 from vladklokun/template-bug-report
chore: Add a Bug Report issue template
2022-08-22 17:32:32 +03:00
David Wertenteil
d25c69abbf Merge pull request #606 from vladklokun/feature-request-template
Add a feature request template
2022-08-22 17:30:23 +03:00
vladklokun
22e1e8a82f chore: Add a Bug Report issue template 2022-08-22 17:28:56 +03:00
vladklokun
c8c3ab76d6 Add a feature request template 2022-08-22 17:19:45 +03:00
Daniel-GrunbergerCA
ad1c39a7e5 go mod tidy 2022-08-22 16:03:10 +03:00
Daniel-GrunbergerCA
e6398872cd change if order 2022-08-22 15:58:09 +03:00
Daniel-GrunbergerCA
811d27529c log error 2022-08-22 15:56:25 +03:00
Daniel-GrunbergerCA
a1efafc871 send mapNamespace to nuimber of resources in report 2022-08-22 15:51:53 +03:00
David Wertenteil
7f2a4bdfd8 use ks namespace 2022-08-21 10:20:29 +03:00
David Wertenteil
8381b2d348 Merge pull request #602 from dwertent/master
Updated dependencies packages
2022-08-18 22:44:51 +03:00
David Wertenteil
a95c2ec42b removing unused function 2022-08-18 22:41:00 +03:00
David Wertenteil
ad91178ef7 updated dependencies pkgs 2022-08-18 17:41:03 +03:00
David Wertenteil
db179d7b67 Merge pull request #601 from vladklokun/refactor-rename-entities
refactor: Rename branded entities to Kubescape
2022-08-18 16:35:21 +03:00
Vlad Klokun
f6e2651f88 refactor!: httphandler: use Kubescape’s updated exported functions 2022-08-18 15:19:36 +03:00
Vlad Klokun
6a52945e5a chore: summeryhelpers.go → summaryhelpers.go
Fixed a typo in filename (summEry → summAry)
2022-08-18 15:19:29 +03:00
Vlad Klokun
f8a66b0f9b refactor!: resourcehandler: rename armoResources to ksResources 2022-08-18 15:19:27 +03:00
Vlad Klokun
bfc3b0cc43 refactor!: resourcehandler: rename armoResources to ksResources 2022-08-18 15:19:25 +03:00
Vlad Klokun
2432378a57 refactor!: resourcehandler: rename armoResources to ksResources 2022-08-18 15:19:22 +03:00
Vlad Klokun
2f1ae9418a chore!: registryadaptors: rename armosec/v1 Go files 2022-08-18 15:19:19 +03:00
Vlad Klokun
619eeb3f02 refactor!: registryadaptors: rename adaptor Armo to KS 2022-08-18 15:19:16 +03:00
Vlad Klokun
ed1862cf72 refactor!: policyhandler/handlenotification.go: rename armoResources to ksResources 2022-08-18 15:19:12 +03:00
Vlad Klokun
40d5b08f39 refactor!: opaprocessor/processorhandlerutils.go: rename getArmoObjects to getKSObjects 2022-08-18 15:19:10 +03:00
Vlad Klokun
fcfccd18dc refactor!: core/submit.go: rename armoAPI to ksCloudAPI 2022-08-18 15:19:07 +03:00
Vlad Klokun
0be1acfe72 refactor!: core/list: rename armoAPI to ksCloudAPI 2022-08-18 15:19:04 +03:00
Vlad Klokun
7407cbb4fb refactor!: core/initutils.go: rename Armo to Kubescape Cloud 2022-08-18 15:19:02 +03:00
Vlad Klokun
79158aa3e5 refactor!: core/delete.go: rename Armo to Kubescape 2022-08-18 15:19:00 +03:00
Vlad Klokun
e7d212fb8c style: format ArmoResource comment 2022-08-18 15:18:56 +03:00
Vlad Klokun
4d6f75a65a refactor!: rename MapArmoResource to MapKSResource 2022-08-18 15:18:54 +03:00
Vlad Klokun
17445ee8b9 refactor!: rename "ArmoResources" to "KSResources" 2022-08-18 15:18:51 +03:00
Vlad Klokun
2de950cce7 chore!: scaninfo_test.go: remove commented out code 2022-08-18 15:18:48 +03:00
Vlad Klokun
326dd096fd docs!: scaninfo.go: remove Armo mentions 2022-08-18 15:18:46 +03:00
Vlad Klokun
416b5e691e chore!: remove commented out code from reportv2tov1 2022-08-18 15:18:45 +03:00
Vlad Klokun
f7d91f1b48 docs: rename CA in comments to Kubescape Cloud 2022-08-18 15:18:43 +03:00
Vlad Klokun
46f823eb89 refactor!: rename "ruleWithArmoOpaDependency" to "ruleWithKSOpaDependency" 2022-08-18 15:18:41 +03:00
Vlad Klokun
e54bfec4c1 refactor!: rename "ArmoResources" to "KSCloudResources" 2022-08-18 15:18:39 +03:00
Vlad Klokun
e95a09dbff docs: "armo" to "kubescape cloud" in customerloader comments 2022-08-18 15:18:35 +03:00
Vlad Klokun
e1f01f963f chore!: rename "armoapi.go" to "kscloudapi.go" 2022-08-18 15:18:32 +03:00
Vlad Klokun
a397f681b3 refactor(armoapiutils)!: rename "armoAPI" to "api" 2022-08-18 15:18:21 +03:00
Vlad Klokun
0b52c498da refactor!: rename "armoAPI" receivers to "api" 2022-08-18 15:18:19 +03:00
Vlad Klokun
5141d82e49 refactor!: rename NewArmoAPICustomized to NewKSCloudCustomized 2022-08-18 15:18:17 +03:00
Vlad Klokun
262c014cfe refactor!: rename "NewARMOAPIStaging" to "NewKSCloudAPIStaging" 2022-08-18 15:18:14 +03:00
Vlad Klokun
dcd4ac9703 refactor!: rename top-level global vars from "armo" to "ksCloud" 2022-08-18 15:18:12 +03:00
Vlad Klokun
566457308f refactor!: rename "NewARMOAPIProd" to "NewKSCloudAPIProd" (Github tests
ratelimit fails here)
2022-08-18 15:18:09 +03:00
Vlad Klokun
c967dbeefc refactor!: rename "NewArmoAPIDev" to "NewKSCloudAPIDev" 2022-08-18 15:18:03 +03:00
Vlad Klokun
0bcef1be3b refactor!: rename "globalArmoAPIConnector" to "globalKSCloudAPIConnector" 2022-08-18 15:18:00 +03:00
Vlad Klokun
11037f1071 refactor!: rename "GetArmoAPIConnector" to "etKSCloudAPIConnector" 2022-08-18 15:17:56 +03:00
Vlad Klokun
bec9fc9c80 refactor!: rename SetArmoAPIConnector to SetKSCloudAPIConnector 2022-08-18 15:17:53 +03:00
Vlad Klokun
7e1cf051e8 refactor!: rename ArmoAPI to KSCloudAPI 2022-08-18 15:17:51 +03:00
Vlad Klokun
7ea8e89766 refactor!: rename "armo" to "kscloud" in RootInfo 2022-08-18 15:17:47 +03:00
Vlad Klokun
4fc20964b3 refactor!: rename armo to kubescape in rootutils 2022-08-18 15:17:43 +03:00
Amir Malka
cbc14a8c83 Merge pull request #595 from armosec/dev 2022-08-16 08:48:42 +03:00
David Wertenteil
355be63b6f Merge pull request #593 from amirmalka/dev
Updated brew commands, ignore markdown in workflows
2022-08-15 18:32:45 +03:00
Amir Malka
29b431009c Ignore markdown changes in workflows 2022-08-15 14:16:41 +03:00
Amir Malka
4114730d91 Updated brew commands 2022-08-15 14:12:43 +03:00
David Wertenteil
b1731531b1 Merge pull request #586 from armosec/dev
Hot fix: fixed url repo displayed
2022-08-08 17:15:27 +03:00
David Wertenteil
d2a092d032 Merge pull request #585 from dwertent/master
Hot fix: fixed url repo displayed
2022-08-08 17:13:37 +03:00
David Wertenteil
4ce8c63044 fixed url displayed 2022-08-08 17:11:45 +03:00
David Wertenteil
5b450be094 Merge pull request #584 from armosec/dev
Microservice swagger support
2022-08-08 10:07:31 +03:00
Lior Alafi
9c80f4d9cb Merge pull request #583 from dwertent/master
Fixed RBAC submit support
2022-08-07 13:13:14 +03:00
David Wertenteil
3c615f180b adding gitlab support 2022-08-07 10:48:02 +03:00
David Wertenteil
13b37abcb4 fixed rbac submit 2022-08-05 00:06:33 +03:00
David Wertenteil
46696d9eb3 fixed link in readme 2022-08-04 16:51:47 +03:00
David Wertenteil
9f450ef0cb Merge pull request #580 from dwertent/master
Adding heap
2022-08-04 15:06:31 +03:00
David Wertenteil
1a15ee757b update readme 2022-08-04 14:25:25 +03:00
David Wertenteil
eab0d6650e -tags=Merge remote-tracking branch 'armosec/dev' 2022-08-03 10:44:35 +03:00
David Wertenteil
2829c77cc8 update failed image scanning message 2022-08-03 10:42:43 +03:00
David Wertenteil
25d3a9004c Merge pull request #572 from vladklokun/add-swagger
docs: Add Swagger Support
2022-08-01 23:05:05 +03:00
Vlad Klokun
b0bdab3ef2 chore: remove swagger.yaml at root 2022-08-01 21:31:44 +03:00
Vlad Klokun
e69cf89fec chore: regenerate swagger.yaml on latest 2022-08-01 21:29:51 +03:00
Vlad Klokun
45007a6aa4 chore: clean up unused files 2022-08-01 21:29:51 +03:00
Vlad Klokun
40e8dd3575 fix: add Swagger file to httphandler package 2022-08-01 21:29:51 +03:00
Vlad Klokun
be92c0a3e1 fix: update go module files 2022-08-01 21:29:51 +03:00
Vlad Klokun
46a1a4ce04 docs: add embedded Swagger spec 2022-08-01 21:29:51 +03:00
Vlad Klokun
4fadb413c3 fix: tag proper JSON field in StatusQueryParams 2022-08-01 21:29:51 +03:00
Vlad Klokun
99436f1b4d refactor: clean up OpenAPI UI serving func 2022-08-01 21:29:51 +03:00
Vlad Klokun
3f7a55c48e wip: feat: serve swagger doc 2022-08-01 21:29:51 +03:00
Vlad Klokun
2fffd25e05 wip: docs: autogenerate Swagger specs 2022-08-01 21:29:51 +03:00
Vlad Klokun
e5d02419f7 docs: add OpenAPI v3 spec 2022-08-01 21:29:51 +03:00
Vlad Klokun
30919d7e9e docs: swagger: extend GET scan endpoint info 2022-08-01 21:29:51 +03:00
Vlad Klokun
96903ea77d docs: swagger: add OpenAPI V2 schema 2022-08-01 21:29:51 +03:00
David Wertenteil
f4572f6f53 adding UTMs 2022-08-01 13:47:01 +03:00
David Wertenteil
55dbafb9b0 Merge branch 'master' of github.com:dwertent/kubescape 2022-08-01 10:03:31 +03:00
David Wertenteil
a6c19bc286 adding pprof 2022-08-01 09:49:50 +03:00
David Wertenteil
c7450adc77 Merge remote-tracking branch 'armosec/dev' 2022-08-01 09:06:39 +03:00
David Wertenteil
f4f3adf576 Merge pull request #581 from avinashupadhya99/update-playground-link-dev
Update link for playground in Readme
2022-07-31 21:07:44 +03:00
Avinash Upadhyaya
0e9ccc955b docs: update link for playground 2022-07-31 21:45:45 +05:30
David Wertenteil
54b502629f Merge branch 'dev' into master 2022-07-31 18:07:10 +03:00
David Wertenteil
8a25d0d293 Merge pull request #576 from amirmalka/dev
helm chart name fix
2022-07-31 18:01:03 +03:00
David Wertenteil
a4af46fcf9 cleaning the readme 2022-07-31 17:35:44 +03:00
David Wertenteil
e9d3b573b3 adding heap api 2022-07-31 15:47:11 +03:00
David Wertenteil
17f48a9bc1 Merge pull request #575 from armosec/fix-for-homebrew
Update Makefile
2022-07-25 15:50:02 +03:00
Amir Malka
32922c6263 helm chart name fix 2022-07-25 15:25:07 +03:00
Amir Malka
57874f399b Update Makefile
To support the new build process in homebrew, we are not using the submodules, hence, adding a dash to ignore an error when git submodule command fails
2022-07-25 12:31:34 +03:00
Moshe Rappaport
5abca6711e Merge pull request #574 from Moshe-Rappaport-CA/dev
Fix get account credentials from ENV
2022-07-25 10:43:41 +03:00
David Wertenteil
875b98415b Merge pull request #571 from amirmalka/dev
Support windows build
2022-07-25 10:26:48 +03:00
Moshe-Rappaport-CA
d577b1a135 Merge remote-tracking branch 'upstream/dev' into dev 2022-07-25 10:20:18 +03:00
David Wertenteil
2cd52e43b0 Merge pull request #573 from amirmalka/include-helm-chart-name
include helm chart name
2022-07-25 09:09:43 +03:00
Moshe-Rappaport-CA
69bdc358eb Fix support account from ENV 2022-07-24 15:52:10 +03:00
Amir Malka
2b2034f2da include helm chart name 2022-07-24 15:10:45 +03:00
Amir Malka
fb114a17a3 Support windows build 2022-07-21 18:51:37 +03:00
David Wertenteil
ba2e4fe16e Merge pull request #570 from armosec/dev
Hot fix - removing URLs from the python build file
2022-07-19 11:42:23 +03:00
David Wertenteil
948681b82e Merge pull request #569 from dwertent/master
Remove URLs from python build file
2022-07-19 11:15:14 +03:00
David Wertenteil
5bd532dd57 remove URLs from python build file 2022-07-19 10:50:46 +03:00
David Wertenteil
aef74d6480 use exteranl go logger 2022-07-18 23:59:56 +03:00
David Wertenteil
ef8565b67f Merge pull request #567 from armosec/dev
Support last commit info
2022-07-18 20:21:24 +03:00
David Wertenteil
7b38b5dc96 Merge pull request #566 from dwertent/master
Fixed repo scanning relative path scanning
2022-07-18 19:00:03 +03:00
David Wertenteil
9f5d9fe36b update go sum 2022-07-18 18:50:15 +03:00
David Wertenteil
643d0620d7 Support relative paths in repo scanning 2022-07-18 18:22:49 +03:00
David Wertenteil
8ecc1839a0 Merge remote-tracking branch 'armosec/dev' 2022-07-18 17:31:16 +03:00
David Wertenteil
31aeae8bd1 Merge pull request #565 from amirmalka/dev
added commit information per file
2022-07-18 17:02:12 +03:00
Amir Malka
26bbcae0bd updated README 2022-07-18 16:44:59 +03:00
Amir Malka
0feca50ebb fix README 2022-07-18 15:39:01 +03:00
Amir Malka
895f330e14 Replaced install_dependencie with Makefile, updated readme 2022-07-18 13:42:58 +03:00
Amir Malka
30f454de08 updated workflow to run also on PR to dev 2022-07-18 11:01:43 +03:00
Amir Malka
8347fa7874 update build 2022-07-17 18:56:20 +03:00
Amir Malka
6b5d335519 update submodule commit 2022-07-17 18:53:17 +03:00
Amir Malka
44f0473a09 fix tests 2022-07-17 18:35:33 +03:00
Amir Malka
a6bae01476 missing tag for go test 2022-07-17 17:58:37 +03:00
Amir Malka
c356246f82 update build process with libgit2 2022-07-17 17:48:19 +03:00
Amir Malka
a6d9badc5f remove file commit information for windows 2022-07-17 12:12:40 +03:00
Amir Malka
5bf179810b use git2go to get file commit information 2022-07-17 10:08:09 +03:00
David Wertenteil
fbb75d6dd1 update go deps 2022-07-12 09:34:13 +03:00
David Wertenteil
ac9db6706c Merge pull request #563 from armosec/decrease-max-report-size
Decrease max report size
2022-07-11 16:27:22 +03:00
Amir Malka
9b489f1e5c Decrease max report size
align max report size with BE configuration
2022-07-11 14:56:29 +03:00
David Wertenteil
ab788eaaa2 Merge pull request #562 from dwertent/master
Fixed URLs
2022-07-10 14:02:10 +03:00
David Wertenteil
826106090b update URL 2022-07-10 14:01:02 +03:00
David Wertenteil
e6e9a74766 fixed tests 2022-07-10 13:57:46 +03:00
David Wertenteil
5fee3efb35 Merge remote-tracking branch 'armosec/dev' 2022-07-10 13:46:34 +03:00
David Wertenteil
a3d77a76aa printing error when failed to load exceptions 2022-07-10 09:53:34 +03:00
David Wertenteil
3a958294f3 Merge pull request #555 from Moshe-Rappaport-CA/dev
Working with worker pool in host sensor
2022-07-07 11:30:45 +03:00
Moshe-Rappaport-CA
086a518a53 Refactor for code aesthetics 2022-07-07 10:38:19 +03:00
David Wertenteil
705fabb32b update dev and stage urls 2022-07-07 07:59:52 +03:00
Moshe-Rappaport-CA
3d37a6ac2f Modify the ScanningTarget to be a cluster or file 2022-07-06 17:08:03 +03:00
Moshe-Rappaport-CA
dd79e348d3 go mod tidy 2022-07-06 11:56:24 +03:00
Moshe-Rappaport-CA
a913d3eb32 Merge remote-tracking branch 'upstream/dev' into dev 2022-07-06 11:40:50 +03:00
Moshe-Rappaport-CA
f32049bdb3 Change "[info] Scanning. cluster:” to be dynamic by targetScan 2022-07-06 11:40:13 +03:00
David Wertenteil
bbcc7a502d Merge pull request #545 from slashben/dev
Replacing the documentation links to the new URL
2022-07-06 11:12:46 +03:00
Ben Hirschberg
2fb2ab02c4 Merge pull request #558 from armosec/dev
Support helm chart scanning and reporting
2022-07-06 10:37:14 +03:00
David Wertenteil
1a94004de4 Merge pull request #557 from dwertent/master
Fixed windows support, update limit size
2022-07-05 16:27:18 +03:00
David Wertenteil
424f2cc403 update report size limit to 4mb 2022-07-05 15:13:02 +03:00
Moshe-Rappaport-CA
bae960fd5b Edit the noOfWorkers to be the minimum between the number of pods and 10 2022-07-05 14:38:58 +03:00
David Wertenteil
eab77a9e61 Merge pull request #556 from dwertent/master
Helm scanning support
2022-07-05 12:16:18 +03:00
David Wertenteil
fc78d9143b use filepath join in unitests 2022-07-05 11:44:07 +03:00
David Wertenteil
034dbca30c update go mod 2022-07-05 11:20:44 +03:00
David Wertenteil
a41adc6c9e update readme 2022-07-05 11:13:39 +03:00
David Wertenteil
bd170938c5 update readme 2022-07-05 11:12:58 +03:00
David Wertenteil
e91a73a32e validate no workloads found 2022-07-05 11:11:17 +03:00
David Wertenteil
099886e1bb mixed merge 2022-07-05 10:34:33 +03:00
David Wertenteil
c05dc8d7ae Merge pull request #548 from amirmalka/dev
helm chart scanning
2022-07-05 09:53:55 +03:00
David Wertenteil
3cebfb3065 Merge branch 'dev' into dev 2022-07-05 09:51:32 +03:00
Moshe-Rappaport-CA
4e9f4a8010 Merge remote-tracking branch 'upstream/dev' into dev 2022-07-03 15:52:42 +03:00
Moshe-Rappaport-CA
94d99da821 Ignore a case where the chan is closed 2022-07-03 15:51:07 +03:00
Ben Hirschberg
ee1b596358 Merge branch 'armosec:dev' into dev 2022-06-30 22:19:02 +03:00
David Wertenteil
f7445d1777 Merge pull request #554 from armosec/dev
Handling edge cases when scanning files
2022-06-30 20:36:54 +03:00
David Wertenteil
ed5abd5791 Merge pull request #553 from dwertent/master
Handling edge cases when scanning files
2022-06-30 19:49:43 +03:00
David Wertenteil
898b847211 fixed printer 2022-06-30 19:41:29 +03:00
David Wertenteil
889dd15772 handke invalide files 2022-06-30 19:33:43 +03:00
Bezbran
2ce6c1840b Merge pull request #543 from armosec/dev
Adding repository scanning support
2022-06-30 15:21:19 +03:00
Moshe-Rappaport-CA
81f0cecb79 Merge remote-tracking branch 'upstream/dev' into dev 2022-06-29 11:02:11 +03:00
David Wertenteil
d46d77411b Merge pull request #549 from armosec/fileutils-update
remove error when reading yaml
2022-06-29 09:09:27 +03:00
Amir Malka
ee4f4d8af1 remove error when reading yaml
Remove an error if we try to read YAML file which is not a map[string]interface{}
2022-06-28 11:31:11 +03:00
Amir Malka
ea1426a24b helm chart scanning 2022-06-27 17:28:25 +03:00
Moshe-Rappaport-CA
120677a91f support in wokerpool in host sensor 2022-06-22 18:40:00 +03:00
shm12
bd78e4c4de Merge pull request #546 from shm12/dev
New host sensor resources
2022-06-22 13:44:07 +03:00
shm12
e3f70b6cd6 Added host sensor new resources 2022-06-21 17:55:18 +03:00
Benyamin Hirschberg
616712cf79 Replacing the documentation links to the new URL 2022-06-20 17:59:21 +03:00
David Wertenteil
a5007df1bc Merge pull request #544 from dwertent/master
fixed docker version
2022-06-19 14:43:49 +03:00
David Wertenteil
d6720b67ed fixed docker version 2022-06-19 14:40:48 +03:00
Amir Malka
2261fd6adb Merge pull request #541 from dwertent/master
Final fixes
2022-06-19 14:14:01 +03:00
David Wertenteil
9334ad6991 fixed typo 2022-06-19 14:11:04 +03:00
David Wertenteil
7b5e4143c3 fixed test for win 2022-06-19 12:47:42 +03:00
David Wertenteil
e63e5502cd fixed test 2022-06-19 11:55:47 +03:00
David Wertenteil
154794e774 fixed test 2022-06-19 11:46:43 +03:00
David Wertenteil
4aa71725dd ignore empty file 2022-06-19 11:19:29 +03:00
David Wertenteil
9bd2e7fea4 upgrade go version 2022-06-19 09:05:32 +03:00
David Wertenteil
e6d3e7d7da fixed test 2022-06-19 08:55:56 +03:00
David Wertenteil
35bb15b5df Merge pull request #540 from 06kellyjac/update_and_install_details
update deps and add nix/nixos install details
2022-06-19 08:55:04 +03:00
David Wertenteil
e54d61fd87 Merge pull request #532 from vladklokun/print-results-to-html
feat: Print results to html
2022-06-19 08:48:30 +03:00
06kellyjac
f28b2836c7 add nixos/nix and go install instructions 2022-06-17 18:44:58 +01:00
06kellyjac
d196f1f327 update dependencies 2022-06-17 18:41:53 +01:00
David Wertenteil
995f90ca53 update pkg 2022-06-16 16:41:25 +03:00
David Wertenteil
c1da380c9b fixed test 2022-06-16 12:13:55 +03:00
David Wertenteil
77f77b8c7d update opa pkg 2022-06-16 12:06:52 +03:00
David Wertenteil
b3c1aec461 fixed unitests 2022-06-15 13:43:45 +03:00
David Wertenteil
ef242b52bb adding file path to wl 2022-06-15 13:38:20 +03:00
Vlad Klokun
af1d5694dc feat: add HTML as an output for scan results 2022-06-14 16:01:07 +03:00
David Wertenteil
a5ac47ff6d Merge pull request #536 from dwertent/master
fixed go mod
2022-06-13 16:13:18 +03:00
David Wertenteil
b03a4974c4 fixed go mod 2022-06-13 15:56:46 +03:00
David Wertenteil
8385cd0bd7 Merge pull request #535 from dwertent/master
fixed build files
2022-06-12 17:40:25 +03:00
David Wertenteil
ca67aa7f5f fixed build files 2022-06-12 17:37:30 +03:00
David Wertenteil
9b9ed514c8 Merge pull request #530 from dwertent/master
beta URL support
2022-06-12 17:34:59 +03:00
David Wertenteil
11b7f6ab2f do not submit invalide account ID 2022-06-12 17:31:44 +03:00
David Wertenteil
021f2074b8 validating slice length 2022-06-12 13:54:45 +03:00
shm12
c1ba2d4b3c Added gitignore for vscode git history files 2022-06-09 16:43:49 +03:00
shm12
141ad17ece Fixed web URL in git repo scanning 2022-06-09 16:42:39 +03:00
shm12
74c81e2270 Fixed relative path in git repo scan 2022-06-09 16:42:03 +03:00
shm12
7bb124b6fe Fix backward competability of file scanning 2022-06-09 15:53:28 +03:00
shm12
8a8ff10b19 Added default pattern, and type filtering in listFiles 2022-06-09 14:55:00 +03:00
shm12
1eef32dd8e Use clone in remote git repositories 2022-06-09 14:53:48 +03:00
David Wertenteil
d7b5dd416d ignore last commit 2022-06-09 10:42:58 +03:00
David Wertenteil
536a94de45 adding git data to file 2022-06-08 16:26:02 +03:00
David Wertenteil
d8ef471eb2 support installation of a fixed version 2022-06-08 13:28:48 +03:00
David Wertenteil
ff07a80078 moved testdata repo 2022-06-07 18:10:32 +03:00
David Wertenteil
310d31a3b1 beta url support 2022-06-07 18:08:38 +03:00
David Wertenteil
8a1ef7da87 submit git scanning 2022-06-07 17:39:02 +03:00
David Wertenteil
c142779ee8 adding client build 2022-06-07 09:20:32 +03:00
Rotem Refael
54020d317e Merge pull request #528 from armosec/rotemamsa-patch-1
Update README.md
2022-06-06 13:45:35 +03:00
Rotem Refael
91d1ec6c2f Update README.md 2022-06-06 13:30:22 +03:00
Rotem Refael
1d3fd0dc9d Merge pull request #527 from vladklokun/add-maintenance-message 2022-06-03 19:43:27 +03:00
Vlad Klokun
8a7511cecb chore: add maintenance message 2022-06-03 19:35:33 +03:00
David Wertenteil
640f366c7e adding grafana dashboard 2022-05-31 15:58:59 +03:00
David Wertenteil
9f36c1d6de supporting github.repository_owner 2022-05-29 08:57:56 +03:00
David Wertenteil
b3c8c078a8 Merge pull request #519 from amirmalka/dev
implemented LocalGitRepository for working with a local git folder
2022-05-29 08:43:45 +03:00
David Wertenteil
0af0c01ec0 Merge pull request #524 from armosec/dev
Quick fix
2022-05-26 12:21:29 +03:00
David Wertenteil
3ff2b0d6ff Merge pull request #523 from dwertent/master
Support client ID and secret key flags
2022-05-26 11:50:35 +03:00
David Wertenteil
35b2b350a0 print submit error 2022-05-26 11:42:24 +03:00
David Wertenteil
046ea1d79f support secret key and account ID from cmd 2022-05-26 11:01:26 +03:00
Rotem Refael
3081508863 Merge pull request #522 from dwertent/master
Adding http request logs
2022-05-25 17:56:50 +03:00
David Wertenteil
4a757c1bf1 adding logs 2022-05-25 17:26:12 +03:00
David Wertenteil
4f1971a63d Merge pull request #520 from armosec/dev
Extend microservice support
2022-05-24 11:07:24 +03:00
David Wertenteil
dec4bcca00 Merge pull request #521 from dwertent/master
Do not submit results every scan with Prometheus
2022-05-24 10:18:20 +03:00
Amir Malka
5443039b8c updated commit date to time.Time and added length checking for remote URLs 2022-05-24 10:09:04 +03:00
David Wertenteil
95e68f49f3 do not submit results every scan with Prometheus 2022-05-24 09:33:40 +03:00
Amir Malka
7e90956b50 implemented LocalGitRepository for working with a local git folder 2022-05-23 17:11:17 +03:00
rcohencyberarmor
0c84c8f1f3 Merge pull request #518 from dwertent/master
Image vuln data integration
2022-05-23 10:51:31 +03:00
David Wertenteil
56b3239e30 loading from file fallback 2022-05-23 10:10:41 +03:00
David Wertenteil
f8e85941da update loading customer config 2022-05-23 09:47:40 +03:00
David Wertenteil
15081aa9c3 update auth url 2022-05-22 15:45:55 +03:00
David Wertenteil
ac03a2bda3 load data from config.json 2022-05-22 15:21:06 +03:00
rcohencyberarmor
b7ffa22f3a Merge pull request #517 from dwertent/master
httphandler using channel for queueing requests
2022-05-22 11:22:31 +03:00
David Wertenteil
ac5e7069da update readme 2022-05-22 10:59:48 +03:00
David Wertenteil
5a83f38bca send prometheus triggering to queue 2022-05-22 09:57:30 +03:00
David Wertenteil
3abd59e290 use channels for triggering scan 2022-05-19 14:18:11 +03:00
David Wertenteil
d08fdf2e9e update status busy to support more than one req 2022-05-19 12:01:28 +03:00
David Wertenteil
bad2f54e72 Merge pull request #515 from dwertent/master
fixed triggerd all frameworks
2022-05-18 17:29:55 +03:00
David Wertenteil
fc9b713851 fixed triggerd all frameworks 2022-05-18 17:28:46 +03:00
rcohencyberarmor
245200840d Merge pull request #514 from dwertent/master
using Buildx in githubactions
2022-05-18 16:11:47 +03:00
David Wertenteil
3f87610e8c using Buildx in githubactions 2022-05-18 16:09:29 +03:00
David Wertenteil
c285cb1bcc Merge pull request #513 from dwertent/master
REST api support
2022-05-18 15:16:00 +03:00
David Wertenteil
63968b564b update k8s-interface pkg 2022-05-18 14:36:55 +03:00
David Wertenteil
e237c48186 merged 2022-05-18 14:24:53 +03:00
David Wertenteil
622b121535 adding scan request log 2022-05-18 13:22:33 +03:00
Bezbran
20774d4a40 Merge pull request #510 from Daniel-GrunbergerCA/master
Set number of worker nodes based on scheduable nodes (based on taints) & set status to 'skipped' when there are no image vulns
2022-05-18 09:40:51 +03:00
DanielGrunbergerCA
7bb6bb85ec go mod 2022-05-18 09:35:58 +03:00
DanielGrunbergerCA
da908a84bc update k8s-iface for http handler 2022-05-18 09:35:07 +03:00
DanielGrunbergerCA
b515e259c0 Merge remote-tracking branch 'upstream/dev' 2022-05-18 09:33:38 +03:00
DanielGrunbergerCA
facd551518 update k8s-interface version 2022-05-18 09:33:13 +03:00
David Wertenteil
0fc569d9d9 fixed import 2022-05-18 00:35:45 +03:00
David Wertenteil
da27a27ad5 adding status rest api 2022-05-18 00:34:15 +03:00
DanielGrunbergerCA
5d4a20f622 fix test 2022-05-17 16:01:03 +03:00
DanielGrunbergerCA
70b15a373b unit test for isEmptyImgVulns 2022-05-17 15:32:49 +03:00
DanielGrunbergerCA
01353f81b3 unit test for isMaterNodeTaints 2022-05-16 17:29:29 +03:00
DanielGrunbergerCA
22f10b6581 go mod 2022-05-16 17:02:55 +03:00
DanielGrunbergerCA
785178ffb1 show skipped for scan without imgvuln 2022-05-16 16:55:37 +03:00
DanielGrunbergerCA
f9b5c58402 pull worker nodes based on taints 2022-05-16 16:36:00 +03:00
David Wertenteil
8ed6d63ce5 Merge pull request #509 from Daniel-GrunbergerCA/fix-eks
Fix eks and support http for all endpoints
2022-05-16 15:22:49 +03:00
DanielGrunbergerCA
990a7c2052 update go mod 2022-05-16 14:28:09 +03:00
DanielGrunbergerCA
09b0c09472 support http and https for all endpoints 2022-05-16 14:13:04 +03:00
DanielGrunbergerCA
f83c38b58e update k8s-interface 2022-05-16 11:51:55 +03:00
DanielGrunbergerCA
51e600797a Merge remote-tracking branch 'upstream/dev' into fix-eks 2022-05-16 11:43:40 +03:00
Rotem Refael
afb6ea1d9c Merge pull request #507 from armosec/dev
- Adding Lens extension to readme
- Supporting --view flag
2022-05-12 10:26:14 +03:00
David Wertenteil
39d6d1fd26 Merge pull request #506 from dwertent/master
Adding `view` flag
2022-05-11 23:11:48 +03:00
David Wertenteil
2dff63b101 rm format-vers flag from examples 2022-05-11 08:22:31 +03:00
David Wertenteil
b928892f0a erge remote-tracking branch 'armosec/dev' 2022-05-11 08:20:32 +03:00
David Wertenteil
c0188ea51d Merge pull request #505 from amirmalka/dev
Updated readme - Lens extension
2022-05-10 15:48:54 +03:00
David Wertenteil
fa376ed5a4 support control view 2022-05-10 14:36:07 +03:00
DanielGrunbergerCA
6382edeb6e Merge remote-tracking branch 'upstream/dev' 2022-05-10 09:05:18 +03:00
Amir Malka
61d6c2dd1f Updated readme - Lens extension 2022-05-09 18:03:01 +03:00
Amir Malka
44194f0b4e Updated readme - Lens extension 2022-05-09 16:46:50 +03:00
DanielGrunbergerCA
7103c7d32c fix url 2022-05-04 11:11:29 +03:00
DanielGrunbergerCA
b4e1663cd1 make parse func 2022-05-03 16:24:19 +03:00
David Wertenteil
b3d16875d6 Merge pull request #493 from armosec/dev
Microservice support
2022-05-03 15:14:24 +03:00
shm12
47412c89ca Merge pull request #501 from dwertent/master
Report ks version
2022-05-03 14:45:56 +03:00
David Wertenteil
20d65f2ed3 Merge remote-tracking branch 'armosec/dev' 2022-05-03 14:27:39 +03:00
David Wertenteil
46a559fb1d reprot ks version 2022-05-03 14:23:23 +03:00
David Wertenteil
2769b22721 Merge pull request #499 from dwertent/master
return response object
2022-05-03 13:28:02 +03:00
DanielGrunbergerCA
60ec6e8294 support env with http 2022-05-03 12:58:33 +03:00
David Wertenteil
63520f9aff return response object 2022-05-02 15:28:29 +03:00
David Wertenteil
333b55a9f2 Merge pull request #497 from Daniel-GrunbergerCA/master
support fixCommand
2022-05-02 13:35:49 +03:00
DanielGrunbergerCA
c6d3fd1a82 check that fixCOmmand is not nul 2022-05-02 13:26:15 +03:00
DanielGrunbergerCA
8106133ed0 go mod 2022-05-02 12:15:25 +03:00
DanielGrunbergerCA
b36111f63e Merge remote-tracking branch 'upstream/dev' 2022-05-02 12:10:13 +03:00
DanielGrunbergerCA
3ad0284394 support fixCOmmand 2022-05-02 11:50:12 +03:00
shm12
245ebf8c41 Merge pull request #496 from dwertent/master
fixed saving error files
2022-05-02 10:42:28 +03:00
David Wertenteil
8309562da1 fixed saving error files 2022-05-01 22:33:37 +03:00
David Wertenteil
de807a65a6 Merge pull request #492 from dwertent/master
Update docker build
2022-04-28 13:50:27 +03:00
David Wertenteil
92fe583421 Merge remote-tracking branch 'armosec/dev' 2022-04-28 13:04:20 +03:00
David Wertenteil
b7ec05e88a adding tests 2022-04-28 13:03:51 +03:00
Daniel Grunberger
203e925888 Merge pull request #491 from dwertent/master
Minor microservice features
2022-04-27 15:28:35 +03:00
David Wertenteil
fde5453bf3 docker user name 2022-04-27 15:25:27 +03:00
David Wertenteil
4c6a65565b support keep in query 2022-04-26 09:31:48 +03:00
David Wertenteil
e60ecfb8f5 Merge pull request #488 from Daniel-GrunbergerCA/master
Check for empty k8s resources in controls related to armo resources
2022-04-25 14:28:52 +03:00
DanielGrunbergerCA
b72e2610ca check tat control is not nil 2022-04-25 12:14:48 +03:00
DanielGrunbergerCA
8d4bae06bc check that control is present 2022-04-25 12:11:05 +03:00
DanielGrunbergerCA
847b597d0f use iface 2022-04-25 09:32:28 +03:00
David Wertenteil
db1743f617 update docker user name 2022-04-19 16:04:02 +03:00
David Wertenteil
7ac1b8aacf return resp object from http req 2022-04-17 14:40:24 +03:00
David Wertenteil
55f8cb1f0e Merge pull request #489 from dwertent/master
Submit repo metadata in context
2022-04-17 08:10:13 +03:00
David Wertenteil
93574736cd update http handler 2022-04-14 11:05:45 +03:00
David Wertenteil
e43f4b1a37 update go mod 2022-04-13 15:47:26 +03:00
David Wertenteil
4ba33578ce sent git repo context 2022-04-13 15:31:48 +03:00
DanielGrunbergerCA
ae00866005 Merge remote-tracking branch 'upstream/dev' 2022-04-13 11:31:03 +03:00
DanielGrunbergerCA
21cb4dae29 fix skipped for controlsd which use both armo and k8s resources 2022-04-13 11:30:51 +03:00
Rotem Refael
cf086e6614 Merge pull request #487 from armosec/dev
Remove binary from repo
2022-04-11 17:20:18 +03:00
Daniel Grunberger
7d3ac98998 Merge pull request #486 from dwertent/master
removed binary
2022-04-11 16:52:43 +03:00
David Wertenteil
5e9d01aec2 removed binary 2022-04-11 16:45:03 +03:00
Rotem Refael
a27d2d41f2 Merge pull request #484 from armosec/dev
CLI improvement release
2022-04-11 15:48:10 +03:00
Daniel Grunberger
c09eabf347 Merge pull request #483 from dwertent/master
update version check
2022-04-11 13:28:25 +03:00
David Wertenteil
38c2aed74a update version check 2022-04-11 12:16:44 +03:00
David Wertenteil
cf70671dba Merge pull request #482 from Daniel-GrunbergerCA/master
Delete cloud logic from kubescape
2022-04-11 10:57:28 +03:00
Daniel Grunberger
f90ce83a74 Merge pull request #481 from dwertent/master
fixed submit url
2022-04-11 10:56:51 +03:00
DanielGrunbergerCA
fab594ee32 rm context name 2022-04-11 10:56:30 +03:00
DanielGrunbergerCA
d25cefe355 rm error msg 2022-04-11 10:49:51 +03:00
DanielGrunbergerCA
747eee1d29 merge 2022-04-11 10:13:41 +03:00
DanielGrunbergerCA
0c43ee9ab8 Merge remote-tracking branch 'upstream/dev' 2022-04-11 10:13:20 +03:00
DanielGrunbergerCA
466f3acd71 change to ge contextname 2022-04-11 09:49:32 +03:00
DanielGrunbergerCA
80add4ef12 Merge branch 'errors-fix' 2022-04-11 09:18:59 +03:00
David Wertenteil
959319c335 fixed submit url 2022-04-11 09:12:30 +03:00
Rotem Refael
0e9ca547cb Merge pull request #480 from dwertent/master
update pkg name to v2
2022-04-11 08:35:18 +03:00
David Wertenteil
6e17e5ce7e Call cmd pkg from root 2022-04-11 07:53:22 +03:00
David Wertenteil
858d7ac2ef update pkg struct 2022-04-10 18:06:28 +03:00
Rotem Refael
4046321297 Merge pull request #467 from dwertent/master
support yaml scan submit
update metrics
update cmd format
2022-04-10 17:03:21 +03:00
David Wertenteil
0cfdabd25a remove v1 format 2022-04-10 16:26:59 +03:00
David Wertenteil
8b6cb6c5d8 adding logs 2022-04-10 11:55:35 +03:00
David Wertenteil
3df3b7766c save policy in file 2022-04-10 09:33:44 +03:00
David Wertenteil
0d83654197 update resource table 2022-04-07 16:44:56 +03:00
David Wertenteil
bd9e44382e format v2 2022-04-07 13:54:49 +03:00
David Wertenteil
2a7c20ea94 report format version 2022-04-07 11:59:19 +03:00
David Wertenteil
bde0dc9a17 convert score to int 2022-04-07 11:00:39 +03:00
David Wertenteil
7d7336ae01 support only one input 2022-04-07 09:53:44 +03:00
David Wertenteil
e5e608324d send file meta 2022-04-06 16:11:57 +03:00
David Wertenteil
569c1444f7 Merge remote-tracking branch 'armosec/dev' 2022-04-06 09:45:32 +03:00
dwertent
dc5ef28324 update output 2022-04-06 09:29:28 +03:00
David Wertenteil
aea6c0eab8 Merge pull request #477 from Daniel-GrunbergerCA/master
Fix error msg for cloud
2022-04-06 09:23:12 +03:00
DanielGrunbergerCA
c80a15d0cf Merge remote-tracking branch 'upstream/dev' 2022-04-05 17:19:11 +03:00
DanielGrunbergerCA
1ddd57aa1d fix error msg for cloud 2022-04-05 17:18:50 +03:00
David Wertenteil
55adb0da6b Merge pull request #474 from Daniel-GrunbergerCA/master
Fix posture control inputs for yaml scan
2022-04-05 16:28:39 +03:00
DanielGrunbergerCA
a716289cc8 go mod 2022-04-05 14:10:11 +03:00
DanielGrunbergerCA
093d71fff4 exit status 1 2022-04-05 14:05:31 +03:00
DanielGrunbergerCA
4fe40e348d Merge branch 'master' of github.com:Daniel-GrunbergerCA/kubescape 2022-04-05 13:40:41 +03:00
DanielGrunbergerCA
29a67b806d Merge remote-tracking branch 'upstream/dev' 2022-04-05 13:39:39 +03:00
DanielGrunbergerCA
0169f42747 Merge remote-tracking branch 'upstream/master' 2022-04-05 13:39:28 +03:00
DanielGrunbergerCA
ed45b09241 Merge remote-tracking branch 'upstream/dev' into errors-fix 2022-04-05 09:25:56 +03:00
DanielGrunbergerCA
107903cc99 Merge branch 'dev' into fix-errors 2022-04-05 09:24:32 +03:00
David Wertenteil
92e100c497 Merge branch 'dev' into master 2022-04-04 13:39:17 +03:00
DanielGrunbergerCA
536fe970f7 fix go mod 2022-04-04 12:31:45 +03:00
DanielGrunbergerCA
85526b06b6 fix control input for yaml scan 2022-04-04 12:27:30 +03:00
dwertent
d9b6c048d5 Merge remote-tracking branch 'armosec/dev' 2022-04-04 12:14:45 +03:00
David Wertenteil
7e46a6529a Merge pull request #473 from Lucifergene/dev
Added Severity Column with colored text
2022-04-04 12:14:35 +03:00
dwertent
2dc5fd80da Merge remote-tracking branch 'armosec/dev' 2022-04-04 12:14:13 +03:00
dwertent
e89cc8ca24 register usesrs download from BE 2022-04-04 12:13:35 +03:00
dwertent
d39aeb0691 update metrics 2022-04-04 11:32:56 +03:00
Lucifergene
da9d98134a Added Severity Column with colored text 2022-04-04 03:46:05 +05:30
David Wertenteil
9992a9a0e4 Merge pull request #472 from falconcode16/master
Improved grammatical mistakes and typos
2022-04-03 10:03:15 +03:00
Rohit Patil
adc8a16e85 Improved grammatical mistakes and typos 2022-04-03 10:40:56 +05:30
DanielGrunbergerCA
13fb586ded Merge remote-tracking branch 'upstream/dev' into dev 2022-03-30 17:37:01 +03:00
DanielGrunbergerCA
2e63982f5a mv cloud logic to k8s-interface 2022-03-30 17:36:15 +03:00
dwertent
58b833c18a support yaml scan submit 2022-03-28 09:40:11 +03:00
Rotem Refael
cb424eab00 Merge pull request #461 from armosec/dev
Microservice support
2022-03-27 17:20:35 +03:00
Rotem Refael
9f2e18c3ee Merge pull request #466 from dwertent/master
udpate armo api types
2022-03-27 17:09:52 +03:00
dwertent
b44a73aea5 udpate armo api types 2022-03-27 17:07:17 +03:00
Rotem Refael
9c5759286f Merge pull request #465 from dwertent/master
Update url support
2022-03-27 16:29:01 +03:00
dwertent
74dc714736 use scan ID 2022-03-27 15:51:29 +03:00
dwertent
83751e22cc fixed report sending 2022-03-27 15:37:11 +03:00
dwertent
db5fdd75c4 inserting scan source 2022-03-25 16:08:07 +03:00
dwertent
4be2104d4b adding githubusercontent tests 2022-03-24 12:37:00 +02:00
dwertent
b6bab7618f loading github token from env 2022-03-24 12:15:54 +02:00
dwertent
3e1fda6f3b fixed test 2022-03-24 11:12:28 +02:00
dwertent
8487a031ee fixed url scanning 2022-03-24 09:45:35 +02:00
David Wertenteil
efbb123fce Merge pull request #464 from dwertent/master
update error display
2022-03-23 09:27:58 +02:00
dwertent
5a335d4f1c update error display 2022-03-23 09:05:36 +02:00
dwertent
5770a823d6 update readme 2022-03-23 08:47:24 +02:00
Rotem Refael
52d7be9108 Add kubescape covarage 2022-03-22 17:42:20 +02:00
David Wertenteil
9512b9c6c4 Merge pull request #463 from Daniel-GrunbergerCA/dev
fix json printer
2022-03-22 09:14:59 +02:00
DanielGrunbergerCA
da9ab642ec rm list initializtion 2022-03-22 09:07:55 +02:00
DanielGrunbergerCA
718ca1c7ab fix json printer 2022-03-22 08:55:36 +02:00
DanielGrunbergerCA
ee3742c5a0 update opa-utils version 2022-03-21 15:36:17 +02:00
DanielGrunbergerCA
7eef843a7a fix resources in report 2022-03-21 15:11:26 +02:00
David Wertenteil
b4a8b06f07 Merge pull request #462 from dwertent/master
update get context
2022-03-21 09:09:12 +02:00
dwertent
4e13609985 update get context 2022-03-21 09:08:01 +02:00
David Wertenteil
2e5e4328f6 Merge pull request #460 from dwertent/master
update readme
2022-03-20 11:30:37 +02:00
dwertent
d98a11a8fa udpate badges 2022-03-20 11:28:56 +02:00
dwertent
bdb25cbb66 adding vs code to readme 2022-03-20 11:08:48 +02:00
David Wertenteil
369804cb6e Merge pull request #459 from shm12/dev
send scan metadata
2022-03-20 10:45:19 +02:00
shm12
1b08a92095 send scan metadata 2022-03-20 10:05:40 +02:00
David Wertenteil
e787454d53 Merge pull request #458 from dwertent/master
fixed json output
2022-03-16 16:58:54 +02:00
dwertent
31d1ba663a json output 2022-03-16 16:58:05 +02:00
David Wertenteil
c3731d8ff6 Merge pull request #457 from dwertent/master
support frameworks from http request
2022-03-16 16:37:40 +02:00
dwertent
c5b46beb1a support frameworks from http request 2022-03-16 16:33:03 +02:00
dwertent
c5ca576c98 Merge remote-tracking branch 'armosec/dev' 2022-03-16 15:27:10 +02:00
dwertent
eae6458b42 fixed cmd init 2022-03-16 15:26:59 +02:00
David Wertenteil
aa1aa913b6 Merge pull request #456 from Daniel-GrunbergerCA/dev
Support status information
2022-03-16 15:17:49 +02:00
DanielGrunbergerCA
44084592cb fixes 2022-03-16 14:16:48 +02:00
DanielGrunbergerCA
6cacfb7b16 refactor 2022-03-16 12:22:21 +02:00
DanielGrunbergerCA
6372ce5647 Merge branch 'dev' 2022-03-16 12:13:16 +02:00
DanielGrunbergerCA
306d3a7081 fix table display 2022-03-16 12:12:39 +02:00
DanielGrunbergerCA
442530061f rm space 2022-03-16 12:09:53 +02:00
DanielGrunbergerCA
961a6f6ebc Merge remote-tracking branch 'upstream/dev' into dev 2022-03-16 12:08:38 +02:00
DanielGrunbergerCA
0d0c8e1b97 support status info 2022-03-16 12:08:04 +02:00
David Wertenteil
5b843ba2c4 Merge pull request #455 from dwertent/master
update prometheus format
2022-03-16 09:32:23 +02:00
dwertent
8f9b46cdbe update prometheus format 2022-03-16 09:25:45 +02:00
David Wertenteil
e16885a044 Merge pull request #452 from dwertent/master
update dockerfile and scan triggering
2022-03-15 22:12:31 +02:00
dwertent
06a2fa05be add ks user to dockerfile 2022-03-15 22:10:27 +02:00
dwertent
d26f90b98e update Prometheus yaml 2022-03-15 18:40:42 +02:00
David Wertenteil
b47c128eb3 Merge pull request #451 from dwertent/master
update prometheus format
2022-03-15 17:12:07 +02:00
dwertent
9d957b3c77 update output 2022-03-15 17:04:59 +02:00
dwertent
8ec5615569 junit format 2022-03-15 16:50:39 +02:00
David Wertenteil
fae73b827a Merge pull request #450 from dwertent/master
build each pkg
2022-03-14 19:27:47 +02:00
dwertent
6477437872 update readme 2022-03-14 19:14:31 +02:00
dwertent
6099f46dea adding docker build 2022-03-14 18:34:34 +02:00
Rotem Refael
5009e6ef47 change gif 2022-03-14 11:33:56 +02:00
Rotem Refael
c4450d3259 add web & CLI Interfaces 2022-03-14 11:27:57 +02:00
Rotem Refael
0c3339f1c9 update gif 2022-03-14 10:28:32 +02:00
Rotem Refael
faee3d5ad6 Add new video to readme 2022-03-14 10:14:55 +02:00
David Wertenteil
a279963b28 Merge pull request #449 from dwertent/master
split to packages
2022-03-13 19:37:02 +02:00
dwertent
f7c0c95d3b adding tests to build 2022-03-13 19:05:06 +02:00
dwertent
b8df07b547 fixed unitest 2022-03-13 18:59:39 +02:00
dwertent
d0e2730518 add cautils to core 2022-03-13 18:14:48 +02:00
dwertent
6dab82f01a fixed output format 2022-03-13 15:03:22 +02:00
dwertent
7a01116db5 adding ks interface 2022-03-13 10:59:38 +02:00
dwertent
8f1e4ceff0 split pkg 2022-03-13 09:59:57 +02:00
David Wertenteil
353a39d66a Merge pull request #448 from dwertent/master
microservice support
2022-03-10 17:17:35 +02:00
dwertent
66196c0d56 pass info in call 2022-03-10 17:13:51 +02:00
dwertent
2d59ba0943 update cmd struct 2022-03-10 17:02:09 +02:00
dwertent
33f92d1a5f update logger support 2022-03-10 11:19:05 +02:00
dwertent
4bd468f03e Merge remote-tracking branch 'armosec/dev' 2022-03-09 20:54:22 +02:00
dwertent
c6eaecd596 export to json 2022-03-09 20:53:55 +02:00
dwertent
a2a5b06024 adding http handler 2022-03-09 20:51:55 +02:00
David Wertenteil
825732f60f Merge pull request #444 from Akasurde/misspell_dev
Misc typo fixes
2022-03-09 20:12:19 +02:00
David Wertenteil
596ec17106 Merge pull request #445 from Akasurde/no_color_dev
cli: added support for no color
2022-03-09 20:01:24 +02:00
Abhijeet Kasurde
fbd0f352c4 cli: added support for no color
Using commandline flag users can now disable colored output
in logging.

Fixes: #434

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-03-09 21:25:48 +05:30
Abhijeet Kasurde
2600052735 Misc typo fixes
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-03-09 21:22:41 +05:30
dwertent
a985b2ce09 Add mock logger 2022-03-08 21:39:09 +02:00
dwertent
829c176644 Merge remote-tracking branch 'armosec/dev' into server-support 2022-03-08 14:52:00 +02:00
dwertent
7d7d247bc2 udpate go mod 2022-03-08 14:51:24 +02:00
dwertent
43ae8e2a81 Merge branch 'master' into server-support 2022-03-08 14:49:41 +02:00
David Wertenteil
b0f37e9465 Merge pull request #441 from xdavidel/update_io_apis
update vulns input / output api
2022-03-08 14:34:45 +02:00
David Wertenteil
396ef55267 Merge pull request #440 from dwertent/master
Use semver.Compare for version check
2022-03-08 10:12:59 +02:00
dwertent
4b07469bb2 use semver.Compare for version check 2022-03-08 10:10:06 +02:00
David Delarosa
260f7b06c1 update vulns input / output api 2022-03-07 17:03:14 +02:00
Rotem Refael
9733178228 Merge pull request #428 from armosec/dev
Release
2022-03-06 11:51:59 +02:00
David Wertenteil
67ba28a3cb Merge pull request #433 from dwertent/master
call `setTenant` when submitting results
2022-03-06 11:29:34 +02:00
dwertent
a768d22a1d call setTenant when submitting results 2022-03-06 11:25:16 +02:00
David Wertenteil
ede88550da Merge pull request #432 from dwertent/master
Update roadmap
2022-03-06 11:03:54 +02:00
David Wertenteil
ab55a0d134 Merge pull request #431 from Bezbran/dev
Read Linux kernel variables from host sensor
2022-03-06 10:59:41 +02:00
Bezalel Brandwine
bfd7060044 read linux kernel variables from host sensor 2022-03-06 10:51:24 +02:00
dwertent
bf215a0f96 update roadmap 2022-03-06 10:50:45 +02:00
dwertent
a2e1fb36df update maintainers 2022-03-06 10:42:30 +02:00
dwertent
4e9c6f34b3 Update maintainers and roadmap 2022-03-06 10:38:03 +02:00
David Wertenteil
b08c0f2ec6 Merge pull request #429 from dwertent/master
Update readme
2022-03-06 09:54:41 +02:00
dwertent
4c0e358afc support submitting v2 2022-03-06 09:51:05 +02:00
dwertent
9ae21b064a update readme 2022-03-06 09:32:26 +02:00
dwertent
2df0c12e10 auto complete examples 2022-03-03 17:45:54 +02:00
David Wertenteil
d37025dc6c json v2 version 2022-03-03 16:17:25 +02:00
dwertent
0b01eb5ee4 swapped print versions 2022-03-03 14:26:34 +02:00
David Wertenteil
d537c56159 Update format output support to v2 2022-03-03 13:24:45 +02:00
dwertent
feb9e3af10 Merge remote-tracking branch 'armosec/dev' 2022-03-03 13:06:36 +02:00
dwertent
ec30ed8439 json v2 support 2022-03-03 13:05:36 +02:00
dwertent
cda9bb0e45 Update junit support 2022-03-03 12:34:03 +02:00
Ben Hirschberg
17f1c6b647 Merge pull request #424 from slashben/dev
added updated road-map
2022-03-01 17:27:39 +02:00
Ben Hirschberg
98079ec1ec added updated roadmap 2022-03-01 17:26:26 +02:00
David Wertenteil
16aaf9b5f8 extend exceptions support 2022-02-28 18:32:49 +02:00
dwertent
ff0264ee15 extend exceptions support 2022-02-28 18:19:17 +02:00
David Wertenteil
bea9bd64a4 Update junit support 2022-02-27 17:33:16 +02:00
dwertent
544a19906e update junit 2022-02-27 17:29:42 +02:00
dwertent
208bb25118 fixed junit support 2022-02-27 16:33:21 +02:00
David Wertenteil
fdb7e278c1 Merge pull request #419 from hayzer/fail-threshold-support-float
Change fail-threshold type to float
2022-02-27 14:56:27 +02:00
David Wertenteil
a132a49d57 extent host-sensor support 2022-02-27 14:45:30 +02:00
dwertent
23e73f5e88 extent host-sensor support 2022-02-27 14:30:32 +02:00
Tomasz Majer
fdcc5e9a66 Support float in fail-threshold 2022-02-27 11:14:05 +01:00
David Wertenteil
77e7b1a2cb Improvments 2022-02-24 18:58:31 +02:00
dwertent
db95da3742 udpate packages 2022-02-24 18:43:29 +02:00
dwertent
dc172a1476 fixed help message 2022-02-24 18:22:29 +02:00
dwertent
8694a929cf support output versions 2022-02-24 13:57:33 +02:00
dwertent
36b3840362 support host sensor from local file 2022-02-24 12:09:47 +02:00
dwertent
d5fcbe842f adding autocompletion 2022-02-24 09:50:12 +02:00
dwertent
155349dac0 adding resource table 2022-02-23 15:54:59 +02:00
David Wertenteil
7956a849d9 Fix argument validation for framework/control 2022-02-23 10:33:49 +02:00
Avinash Upadhyaya
0d1c4cdc02 fix: argument validation for framework/control 2022-02-23 10:24:14 +05:30
David Wertenteil
8c833a5df8 Ignore empty frameworks 2022-02-22 14:48:10 +02:00
dwertent
2c5bb977cb ignore empty framewprks 2022-02-22 14:46:25 +02:00
dwertent
cddf7dd8f6 handle errors 2022-02-22 11:03:44 +02:00
dwertent
306c18147e Merge remote-tracking branch 'upstream/dev' 2022-02-22 10:49:57 +02:00
David Wertenteil
84815eb97d fix uuid high-risk vulnerability 2022-02-22 10:26:56 +02:00
dwertent
890c13a91f stage url 2022-02-22 09:53:40 +02:00
fsl
3887ec8091 fix uuid high-risk vulnerability 2022-02-22 10:29:23 +08:00
fsl
726b06bb70 Merge remote-tracking branch 'origin/dev' into dev 2022-02-22 10:19:30 +08:00
dwertent
c8e07c283e Merge remote-tracking branch 'upstream/dev' 2022-02-21 17:24:32 +02:00
dwertent
88a5128c03 fixed pretty-print v1, expand list support 2022-02-21 17:22:01 +02:00
dwertent
01f2d3b04f Merge branch 'dev' of ssh://github.com/armosec/kubescape into dev 2022-02-21 14:48:53 +02:00
dwertent
fef85a4467 init printer for all pkg 2022-02-21 14:48:48 +02:00
David Wertenteil
e0eadc1f2d support for pdf format output
Resolves #282
2022-02-21 14:47:48 +02:00
dwertent
a881b73e8d Merge remote-tracking branch 'pdf/master' into dev 2022-02-21 10:21:05 +02:00
dwertent
606f5cfb62 fixed discord banner 2022-02-21 09:00:34 +02:00
Rotem Refael
40737d545b Merge pull request #403 from armosec/dev (update logger/cache/ docker build)
Add explicit protocol to solve known K8s 1.16 issue
Post scan message update
Support zap logger (KS_LOGGER_NAME)
Support cache dir location (--cache-dir/KS_CACHE_DIR)
Fixed docker release version
Issues:

Resolved option disable createTenant when using the offline scan option #397
Resolved Mutated release binaries #98
2022-02-20 21:33:15 +02:00
dwertent
990be3afe8 remove cat command 2022-02-20 20:55:22 +02:00
David Wertenteil
7020c2d025 Updating cache handling 2022-02-20 19:06:38 +02:00
dwertent
a6497c1252 fixed python build file 2022-02-20 19:04:16 +02:00
dwertent
9d528a8075 support setting default cach 2022-02-20 13:30:05 +02:00
David Wertenteil
5aec8b6f28 Fix release version in Dockerfile 2022-02-20 09:08:10 +02:00
Avinash Upadhyaya
830ee27169 build: fix release version in Dockerfile 2022-02-20 10:26:40 +05:30
alegrey91
5f2e5c6f4e docs: describe support for pdf format output 2022-02-17 18:17:12 +01:00
alegrey91
cf4317b5f6 feat(resulthandling): add support for pdf format output 2022-02-17 18:16:29 +01:00
David Wertenteil
2453aea6f3 Support zap logger 2022-02-17 17:49:24 +02:00
dwertent
e95b0f840a Support zap logger 2022-02-17 17:47:57 +02:00
David Wertenteil
83680d1207 AccountID handling 2022-02-17 09:30:25 +02:00
dwertent
fd135e9e49 Cache accountID only when submitting data 2022-02-17 09:23:17 +02:00
dwertent
e47eb9cb4e adding logs to python file 2022-02-16 14:02:28 +02:00
dwertent
d288fdc7f2 set tenant only when submiiting data 2022-02-16 13:59:29 +02:00
dwertent
9de73dab29 updalead sha 2022-02-16 13:15:44 +02:00
David Wertenteil
f0afc20ec6 Update post scan message 2022-02-16 10:03:03 +02:00
dwertent
bf75059347 update after scan messgae 2022-02-15 14:25:28 +02:00
David Wertenteil
78835a58c4 add explicit protocol TCP to host-sensor YAML 2022-02-12 19:02:59 +02:00
David Wertenteil
fdccae9a1e [Minor] Typo Correction 2022-02-12 19:01:10 +02:00
avicoder
6d97d42f67 Merge pull request #1 from avicoder/avicoder-typo-fix
[Minor] Fixed a Typo
2022-02-11 03:17:38 +08:00
avicoder
46001e4761 [Minor] Fixed a Typo
Useage to Usage
2022-02-11 03:17:10 +08:00
dwertent
37644e1f57 update readme 2022-02-10 21:05:08 +02:00
dwertent
8a04934fbd Adding readme and yaml 2022-02-10 20:41:28 +02:00
dwertent
31e1b3055f Prometheus support 2022-02-10 20:11:00 +02:00
Bezalel Brandwine
b4d712fcb1 add explicit protocol to solve known K8s issue:
https://github.com/kubernetes/kubernetes/issues/92332
2022-02-10 17:38:13 +02:00
Rotem Refael
7847a4593b Merge pull request #381 from armosec/dev
Minor updates
2022-02-10 16:33:43 +02:00
David Wertenteil
b2036e64f1 Merge pull request #380 from dwertent/master
Hot fix
2022-02-10 14:07:34 +02:00
Bezbran
fd0bbcccfe Merge pull request #16 from armosec/dev
Dev
2022-02-10 13:43:49 +02:00
dwertent
7caa47f949 Merge remote-tracking branch 'upstream/dev' 2022-02-10 13:41:16 +02:00
David Wertenteil
06b171901d Track host sensor pods reports 2022-02-10 13:34:05 +02:00
dwertent
e685fe2b7d update download readme 2022-02-10 11:42:42 +02:00
Bezalel Brandwine
7177e77a8d track host sensor pods tighten 2022-02-10 11:23:55 +02:00
dwertent
4cda32771b fixed url scanning 2022-02-10 09:24:46 +02:00
dwertent
f896b65a87 fixed eks cluster name 2022-02-10 08:55:28 +02:00
David Wertenteil
3fff1b750a fixed Set image version 2022-02-09 14:38:05 +02:00
dwertent
2380317953 fixed Set image version 2022-02-09 14:16:32 +02:00
Rotem Refael
bd9ade4d15 Merge pull request #370 from armosec/dev
Features:
Adding a logger
Support config command

Minor fixes
2022-02-09 14:02:21 +02:00
dwertent
659d3533ee disable cosign 2022-02-09 13:29:46 +02:00
Rotem Refael
37c242576e Merge pull request #373 from Bezbran/dev
[housekeeper] add readiness checks
2022-02-09 09:45:54 +02:00
Bezalel Brandwine
e9a22a23e7 [housekeeper] add readiness checks 2022-02-09 09:35:39 +02:00
David Wertenteil
ae3816c1e0 [host sensor] fix name of log field 2022-02-09 09:00:57 +02:00
Bezalel Brandwine
e4661a5ae2 [host sensor] fix name of log field 2022-02-09 08:50:47 +02:00
Bezbran
539d1889fe Merge pull request #15 from armosec/dev
Dev
2022-02-09 08:23:54 +02:00
David Wertenteil
2dd5f05f1a Replace call to fmt.print to logger call 2022-02-08 22:10:07 +02:00
dwertent
60c9b38de4 replace print by logger 2022-02-08 22:08:41 +02:00
dwertent
8b66b068ea remove publish image file 2022-02-08 15:55:53 +02:00
dwertent
1507bc3f04 update helm readme 2022-02-08 15:54:05 +02:00
David Wertenteil
1e0baba919 fixed dev version 2022-02-08 15:15:29 +02:00
dwertent
4c9f47b1e1 fixed dev version 2022-02-08 15:14:10 +02:00
David Wertenteil
b66446b7eb Update auth urls 2022-02-08 14:47:28 +02:00
dwertent
f1726e21ae ignore casign 2022-02-08 14:45:23 +02:00
dwertent
8d48f8ad86 adding logger 2022-02-08 14:23:54 +02:00
dwertent
8b280f272e update auth url 2022-02-08 14:21:39 +02:00
David Wertenteil
b92d4256ad Fixed build.yaml and do not push docker in other repos 2022-02-08 14:13:10 +02:00
dwertent
914a04a386 fixed builld dev 2022-02-08 14:02:53 +02:00
dwertent
12f3dd7db6 update build 2022-02-08 13:45:31 +02:00
dwertent
427032ab94 testing workflow 2022-02-08 11:27:41 +02:00
David Wertenteil
b55aaaa34d chore: sign container image with cosign 2022-02-08 11:00:45 +02:00
David Wertenteil
7cde877452 Minor fixes 2022-02-07 17:41:25 +02:00
dwertent
e399012f73 fixed glob files 2022-02-07 17:36:47 +02:00
dwertent
fe1d2646bd fixed glob files 2022-02-07 16:08:57 +02:00
dwertent
ea98bfbe9a Merge remote-tracking branch 'upstream/dev' 2022-02-07 15:38:11 +02:00
dwertent
7bc3277634 support scanning all with yaml files 2022-02-07 15:37:57 +02:00
dwertent
22e94c5a29 typo 2022-02-07 15:37:30 +02:00
dwertent
aa8cf0ff15 fixed python build 2022-02-07 11:18:23 +02:00
dwertent
a22f97bd13 fixed python build 2022-02-07 10:56:39 +02:00
David Wertenteil
3fd2d1629d Adding logger and submitting exceptions 2022-02-06 19:05:00 +02:00
dwertent
cd04204a5c fixed url 2022-02-06 18:19:35 +02:00
dwertent
eee55376e7 Merge remote-tracking branch 'upstream/dev' 2022-02-06 17:14:28 +02:00
dwertent
d3c0972d70 submit exceptions 2022-02-06 17:12:59 +02:00
David Wertenteil
e3f5fa8e35 update version of rbac pkg - show highest parent in SAID2WLID map 2022-02-06 16:36:20 +02:00
dwertent
03c540b68c support armosec login 2022-02-06 16:35:39 +02:00
yiscah
7f2f53b06c update version of rbac pkg - show highest parent in SAID2WLID map 2022-02-06 13:50:48 +02:00
dwertent
8064826b53 init logger 2022-02-06 12:01:26 +02:00
dwertent
8bdff31693 replace print with logger 2022-02-06 11:13:33 +02:00
Batuhan Apaydın
6f05b4137b chore: sign container image with cosign
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-02-04 12:16:07 +03:00
dwertent
4207f3d6d1 using logger 2022-02-03 18:12:35 +02:00
dwertent
98dbda696d update exception support 2022-02-03 16:44:57 +02:00
dwertent
7a34c94542 adding logger 2022-02-03 15:42:37 +02:00
David Wertenteil
789b93776d support fixPaths 2022-02-03 15:28:24 +02:00
yiscah
c93ee64630 allow case of both failpath and fixpath exist 2022-02-03 13:13:18 +02:00
yiscah
f54c3ad85c Merge branch 'dev' of ssh://github.com/armosec/kubescape into dev 2022-02-03 13:03:27 +02:00
David Wertenteil
a9fcd00723 Support image-vulnerabilities related controls 2022-02-03 12:48:41 +02:00
yiscah
fb7cc4284e support fixPaths 2022-02-03 12:29:28 +02:00
dwertent
e7a0755c25 report ClusterAPIServerInfo 2022-02-03 10:32:00 +02:00
dwertent
d1e02dc298 update config command 2022-02-02 14:24:53 +02:00
dwertent
69814039ca using accountID instead of customerGUID 2022-02-02 08:12:41 +02:00
dwertent
2ffb7fcdb4 support view/set/delete commands 2022-02-01 17:16:27 +02:00
dwertent
d1695b7f10 support vuln scan 2022-01-31 18:41:45 +02:00
raziel
5f0f9a9eae correct nil derefrance 2022-01-31 17:13:48 +02:00
dwertent
aa2dedb76f Merge branch 'master' into vuln-support 2022-01-30 14:03:46 +02:00
David Wertenteil
d630811386 Minor fixes 2022-01-30 11:21:54 +02:00
David Wertenteil
407e35c9d8 Merge pull request #356 from dwertent/master
load cloud provider from env
2022-01-30 11:09:45 +02:00
dwertent
bb7f38ce31 load cloud provider from env 2022-01-30 11:09:02 +02:00
David Wertenteil
1ffb2d360a Merge pull request #351 from wim-de-groot/master
Fixes(#333) Added length check to prevent panic
2022-01-30 08:43:36 +02:00
David Wertenteil
5cbadc02c5 Minor fixes 2022-01-30 08:17:43 +02:00
dwertent
9aa8d9edf0 Merge remote-tracking branch 'upstream/dev' 2022-01-30 08:14:31 +02:00
dwertent
db84380844 print summary and scoe 2022-01-30 08:14:10 +02:00
dwertent
bbb0d2154f fixed version print 2022-01-30 08:06:50 +02:00
Wim de Groot
2a937ac7c0 Merge branch 'dev' into master 2022-01-27 09:36:52 +01:00
Wim de Groot
a96652094e Added length check to prevent panic (#333)
Signed-off-by: Wim de Groot <34519486+degrootwim@users.noreply.github.com>
2022-01-26 14:57:19 +01:00
David Wertenteil
dbf3de57f6 Prevent index out of range [0] when control report does not have rules 2022-01-26 10:19:04 +02:00
Rotem Refael
c00bc0ebbb Merge pull request #348 from armosec/dev
Fixing null pointer crash in GKE
2022-01-24 17:15:30 +02:00
Ben Hirschberg
b08e5a2c32 Merge pull request #347 from slashben/dev
Fixing null pointer exception in case of in-cluster installation
2022-01-24 16:47:54 +02:00
Ben Hirschberg
09db5d94e1 Fixing null pointer exception in case of in-cluster installation 2022-01-24 16:47:12 +02:00
Rotem Refael
033e8f6b44 Merge pull request #346 from armosec/dev
returning rbac submit code + fix crash
2022-01-24 12:40:33 +02:00
Ben Hirschberg
bef40f0e6c Merge pull request #344 from slashben/dev
returning RBAC submit table
2022-01-24 09:13:28 +02:00
Ben Hirschberg
aa2f69125f returning rbac submit code 2022-01-24 09:12:13 +02:00
Ben Hirschberg
d30f3960a7 Merge pull request #341 from slashben/dev
fixing the crash around submit rbac
2022-01-23 21:28:10 +02:00
Ben Hirschberg
5f43da94ba fixing the crash around submit rbac 2022-01-23 20:17:03 +02:00
Rotem Refael
2aa8a0c935 Merge pull request #340 from Anthirian/dev
Fix typo in namespace
2022-01-23 13:43:42 +02:00
Ben Hirschberg
c02f8c6cb5 Merge pull request #338 from vfarcic/dev
Video
2022-01-23 08:18:44 +02:00
Geert Smelt
aa0be474e2 Fix typo in namespace 2022-01-21 15:40:00 +01:00
Viktor Farcic
c0161c9b33 Video 2022-01-20 19:54:57 +01:00
Quirino Gervacio
71404f2205 Prevent index out of range [0] when control report do not have a rule report 2022-01-20 04:51:04 +08:00
Rotem Refael
514da1e2db Merge pull request #332 from armosec/dev
Emergency fix: checking kube context before use
2022-01-19 16:53:14 +02:00
Ben Hirschberg
75dfceb5da Merge pull request #331 from slashben/dev
checking if local context exists before using
2022-01-19 16:38:22 +02:00
Ben Hirschberg
1ae76b4377 checking if context exists 2022-01-19 16:37:32 +02:00
Rotem Refael
b6f90cba8e Merge pull request #330 from armosec/dev
New kubescape major version
2022-01-19 15:21:52 +02:00
rrefael
62af441a1d Increase release & tag to major 2022-01-19 09:19:16 +02:00
Rotem Refael
228b8957d3 Merge pull request #317 from armosec/report-refactor
- Support report v2 (pagination)
- Scan control only once
- Support download of exceptions,control-configuration,artifacts -> kubescape download
- Support listing frameworks and controls -> kubescape list
- Adding scan framework all for scanning yaml files
- Scan other kubernetes contexts by adding the --kube-context flag
2022-01-18 21:02:56 +02:00
YiscahLevySilas1
b4ce999ab3 Merge pull request #324 from YiscahLevySilas1/dev
added download + load artifacts to readme
2022-01-18 18:02:34 +02:00
yiscah
cc06a414fe added examples of download + load artifacts 2022-01-18 17:50:28 +02:00
YiscahLevySilas1
d3c37c4e5f Merge branch 'armosec:dev' into dev 2022-01-18 17:30:36 +02:00
YiscahLevySilas1
3b448b62b1 Merge pull request #323 from YiscahLevySilas1/dev
support load artifacts from local path
2022-01-18 17:28:08 +02:00
YiscahLevySilas1
6a3f5658b1 Merge branch 'report-refactor' into dev 2022-01-18 17:19:03 +02:00
yiscah
f65e791522 fix parsing local path to artifacts 2022-01-18 17:01:53 +02:00
yiscah
d91304f9ad setUseArtifactsFrom only when flag is set 2022-01-18 16:32:01 +02:00
yiscah
61ce00108e fixed download to local path 2022-01-18 15:29:35 +02:00
Ben Hirschberg
a4eb773eee Merge pull request #322 from slashben/dev
Adding examples for cloud integrations
2022-01-18 15:05:47 +02:00
Ben Hirschberg
cfc69f5a0f adding access to container registry 2022-01-18 14:41:07 +02:00
Ben Hirschberg
a44823c3ed example cloud integration scripts 2022-01-17 13:55:43 +02:00
Ben Hirschberg
8a166e5ba5 typo fix 2022-01-17 11:54:02 +02:00
rrefael
9a7aeff870 update overview text- README 2022-01-16 15:40:34 +02:00
Lior Alafi
cb3bdb9df2 supporting both structures for score calculation 2022-01-14 17:54:39 +02:00
rrefael
0be8d57eaa add --enable-host-scan flag 2022-01-13 15:44:21 +02:00
dwertent
79b9cbf1d6 Merge branch 'report-refactor' 2022-01-13 15:16:15 +02:00
dwertent
500df8737e send small clusters once 2022-01-13 15:03:23 +02:00
David Wertenteil
b8acbd1bee fixed flag and cloud env support 2022-01-13 14:19:26 +02:00
dwertent
0bde8a65ba fixed context flag 2022-01-13 14:16:36 +02:00
dwertent
d2884b8936 update failure message 2022-01-13 13:07:29 +02:00
dwertent
e692359b47 Merge remote-tracking branch 'dwertent/master' into report-refactor 2022-01-13 12:52:34 +02:00
dwertent
473746eab0 merged with Daniels branch 2022-01-13 12:50:50 +02:00
dwertent
050878cbd6 Merge remote-tracking branch 'dwertent/master' into report-refactor 2022-01-13 11:48:13 +02:00
dwertent
e100f18bb0 fixed tests 2022-01-13 11:44:46 +02:00
dwertent
05c82fc166 Merge remote-tracking branch 'dwertent/master' into dev 2022-01-13 11:36:15 +02:00
dwertent
839c3e261f swap result and resource 2022-01-13 11:04:09 +02:00
dwertent
95b579d191 fixed resource list 2022-01-12 14:03:12 +02:00
Bezbran
8656715753 Merge pull request #314 from alegrey91/master
move kube-host-sensor manifest to indipendent yaml file with embed capability
2022-01-12 09:39:26 +02:00
dwertent
05b6394c5c send report to v2 2022-01-11 14:21:16 +02:00
dwertent
72860deb0f update struct, adding mock struct 2022-01-11 10:43:53 +02:00
Rotem Refael
d3bdbf31ac Merge pull request #315 from armosec/dev
Typo fixes
Update Kubescape logo
Adding contributors

Issues:
- Closes Spelling error Namescape should be Namespace #296
- Closes Add contributors to Readme #307
2022-01-11 09:58:36 +02:00
David Wertenteil
639c694c13 Merge pull request #5 from slashben/master
Armo interface
2022-01-11 09:35:12 +02:00
Ben Hirschberg
f34f6dc51e GetImageVulnerabilty is working 2022-01-11 00:42:26 +02:00
Ben Hirschberg
b93e7b9abf take only the first result 2022-01-10 22:48:00 +02:00
yiscah
995f615b10 support load artifacts from local path 2022-01-10 20:00:42 +02:00
Ben Hirschberg
39b95eff4f got full auth cycle 2022-01-10 19:50:07 +02:00
alegrey91
392625b774 style(host-sensor): move kube-host-sensor manifest to indipendent yaml file 2022-01-10 18:39:06 +01:00
dwertent
306b9d28ca ignore skipped resources 2022-01-10 15:21:31 +02:00
dwertent
6fe87bba20 Merge branch 'dev' of github.com:dwertent/kubescape into dev 2022-01-10 13:46:19 +02:00
David Wertenteil
c0d534072d print downloaded artifacts 2022-01-10 13:45:43 +02:00
dwertent
009221aa98 report 2022-01-10 10:21:42 +02:00
yiscah
46e5aff5f9 each artifact handle print seprately 2022-01-10 09:07:06 +02:00
YiscahLevySilas1
59498361e7 Merge pull request #3 from dwertent/dev
Dev
2022-01-10 08:35:40 +02:00
dwertent
c652da130d adding download examples 2022-01-10 08:13:44 +02:00
Ben Hirschberg
83246a1802 generalizing url settings 2022-01-10 08:10:40 +02:00
Ben Hirschberg
f255df0198 login first part 2022-01-10 07:39:54 +02:00
David Wertenteil
9e524ffc34 support download artifacts 2022-01-09 17:37:26 +02:00
David Wertenteil
004cc0c469 Merge branch 'dev' into dev 2022-01-09 17:37:12 +02:00
Ben Hirschberg
52b78a7e73 Merge branch 'armosec:master' into master 2022-01-09 16:47:41 +02:00
dwertent
bd089d76af adding cluster flag - support submiting yaml file 2022-01-09 16:13:15 +02:00
yiscah
d5025b54bf handle error for each artifact download seprately 2022-01-09 15:12:03 +02:00
dwertent
740497047d cli print support v2 2022-01-09 10:33:47 +02:00
Ben Hirschberg
3f6cbd57b2 Merge pull request #311 from saiyam1814/patch-1
Adding Kubescape katacoda playground
2022-01-08 18:16:50 +02:00
Saiyam Pathak
2c9524ed45 Adding Kubescape katacoda playground 2022-01-08 19:21:33 +05:30
Ben Hirschberg
384922680a Merge pull request #309 from saiyam1814/master
Adding Contributors
2022-01-07 15:41:53 +02:00
David Wertenteil
d2e9f8f4f8 Fixes #296 Spelling error Namescape should be Namespace 2022-01-07 14:25:24 +02:00
Saiyam Pathak
b4f10f854e Adding contributors 2022-01-07 11:27:32 +05:30
Clint Modien
8ce64d2a7f Fixes #296 Spelling error Namescape should be Namespace 2022-01-06 09:45:11 -08:00
yiscah
d917e21364 support download artifacts 2022-01-06 17:44:50 +02:00
YiscahLevySilas1
32cedaf565 Merge branch 'armosec:dev' into dev 2022-01-06 17:44:23 +02:00
dwertent
4c2a5e9a11 suooirt scan all 2022-01-06 16:21:41 +02:00
dwertent
a41d2a46ff cli support list 2022-01-06 15:28:01 +02:00
dwertent
4794cbfb36 update opa version 2022-01-06 14:31:46 +02:00
rrefael
d021217cf7 add new logo 2022-01-06 14:19:13 +02:00
dwertent
4573d83831 fixed counters and skipped ctr 2022-01-06 13:05:51 +02:00
Ben Hirschberg
2bb612ca3f Merge pull request #303 from armosec/slashben-roadmap-branch
Create roadmap.md
2022-01-06 11:12:48 +02:00
Ben Hirschberg
35534112c6 Create MAINTAINERS.md 2022-01-06 11:10:21 +02:00
Ben Hirschberg
f51e531f3a fixing typos 2022-01-06 11:04:28 +02:00
Ben Hirschberg
2490856ccb Update roadmap.md 2022-01-06 11:02:37 +02:00
Ben Hirschberg
9a5a87b027 Create CODE_OF_CONDUCT.md 2022-01-06 10:44:28 +02:00
Ben Hirschberg
45b8c89865 Create roadmap.md 2022-01-06 10:30:08 +02:00
YiscahLevySilas1
e68e6dcd3d Merge pull request #1 from dwertent/master
Download policies support
2022-01-06 08:51:16 +02:00
dwertent
670ff4a15d support download 2022-01-05 20:46:56 +02:00
dwertent
b616a37800 fixed test 2022-01-05 16:45:50 +02:00
dwertent
ce488a3645 update latest fixes 2022-01-05 16:45:02 +02:00
dwertent
fb47a9c742 support v2 printing 2022-01-05 16:38:37 +02:00
David Wertenteil
80ace81a12 Fixing typo in the ActionSendReport error message 2022-01-05 16:16:52 +02:00
yiscah
1efdae5197 begin download config + download exceptions 2022-01-05 15:56:38 +02:00
yiscah
a4c88edfca begin download config + download exceptions 2022-01-05 15:56:24 +02:00
YiscahLevySilas1
8f38c2f627 Merge branch 'armosec:dev' into dev 2022-01-05 15:10:49 +02:00
Jonas Kint
bbf68d4ce8 Fixing typo in the ActionSendReport error message 2022-01-05 13:49:26 +01:00
dwertent
e1eec47a22 fixed report 2022-01-04 18:28:48 +02:00
Rotem Refael
fc05075817 Merge pull request #294 from armosec/dev
Minor features and improvements
2022-01-04 15:29:55 +02:00
dwertent
5bb64b634a support loading ks config in env 2022-01-04 14:42:25 +02:00
dwertent
7bc2c2be13 fliter ot reources based on owners 2022-01-03 13:36:29 +02:00
yiscah
27e2c044da update rbac-utils version for SAID2WLIDmap obj 2022-01-03 09:59:34 +02:00
dwertent
1213e8d6ac convert reports 2022-01-02 21:46:09 +02:00
dwertent
3f58d68d2a mocks 2021-12-30 17:48:42 +02:00
Rotem Refael
803e62020e add devopsbest framework 2021-12-30 16:40:07 +02:00
dwertent
fde437312f report v1 to v2 2021-12-30 11:52:17 +02:00
Ben Hirschberg
18425c915b Merge pull request #291 from slashben/dev
adding container image vulnerability adaptor proposal
2021-12-30 10:44:57 +02:00
Benyamin Hirschberg
0de6892ddd adding container image vunerability adaptor proposal 2021-12-30 10:44:08 +02:00
David Wertenteil
dfb92ffec3 Remove RBAC deprecated objects 2021-12-29 17:49:52 +02:00
Ben Hirschberg
b7842f98f0 Merge branch 'armosec:master' into master 2021-12-29 16:28:35 +02:00
yiscah
85317f1ee1 Merge branch 'dev' of https://github.com/YiscahLevySilas1/kubescape into dev 2021-12-29 16:23:29 +02:00
yiscah
f22f60508f rbacTable and rbac struct deprecated 2021-12-29 16:23:14 +02:00
dwertent
716bdaaf38 support kind List 2021-12-29 12:06:48 +02:00
dwertent
1b0e2b87de Handle all resources failure 2021-12-28 10:47:12 +02:00
David Wertenteil
2c57b809d2 show warnings for host sensor and send kubelet cmd 2021-12-28 10:42:26 +02:00
David Wertenteil
d9c96db212 Merge branch 'dev' into master 2021-12-28 10:41:39 +02:00
Daniel-GrunbergerCA
5f7391a76b stdout to stderror 2021-12-28 09:20:05 +02:00
Daniel-GrunbergerCA
accd80eda8 rm cmdline map 2021-12-28 09:07:50 +02:00
Daniel-GrunbergerCA
e49499f085 use regoes from master 2021-12-27 08:45:50 +02:00
David Delarosa
521f8930d7 Merge branch 'dev' into dev 2021-12-26 14:43:06 +02:00
David Wertenteil
11b9a8eb6e fix ControlsInputsGetter init 2021-12-23 17:39:49 +02:00
yiscah
0d4350ae24 fix ControlsInputsGetter init 2021-12-23 17:31:23 +02:00
David Wertenteil
62a6a25aa1 support pulling config inputs from git 2021-12-23 16:48:29 +02:00
yiscah
14a74e7312 support pulling config inputs from git 2021-12-23 10:33:23 +02:00
Rotem Refael
3fad2f3430 Merge pull request #279 from armosec/dev
Cli improvements
2021-12-22 21:16:54 +02:00
David Delarosa
c35d1e8791 Use stderr
By using stderr fd we can separate the information logs from the
application output
2021-12-22 20:27:38 +02:00
David Wertenteil
0367255a2a cli improvement
* Support risk-score calculation
* Update spinner support
* Update url display
* Adding control url to each control
2021-12-22 16:56:11 +02:00
dwertent
f5f5552ecd support threshold 2021-12-22 16:48:18 +02:00
dwertent
046a22bd2b print to error stderr 2021-12-22 12:59:46 +02:00
Daniel-GrunbergerCA
ad94ac7595 rm json print 2021-12-22 08:29:35 +02:00
Daniel-GrunbergerCA
cfa3993b79 print json 2021-12-21 20:31:12 +02:00
Daniel-GrunbergerCA
972793b98a print json 2021-12-21 20:27:23 +02:00
Daniel-GrunbergerCA
35682bf5b8 pull regoes from dev 2021-12-21 19:02:16 +02:00
Daniel-GrunbergerCA
b023f592aa Merge remote-tracking branch 'upstream/dev' 2021-12-21 13:37:32 +02:00
Daniel-GrunbergerCA
a1c34646f1 waning for host sensor 2021-12-21 13:34:31 +02:00
David Wertenteil
9ac3768f1d Merge pull request #277 from dwertent/master
Fixed host sensor ignore ns
2021-12-21 13:23:20 +02:00
dwertent
ff7881130f fixed host sensor issue 2021-12-21 13:09:31 +02:00
dwertent
37effda7c5 update pkg 2021-12-21 11:04:18 +02:00
Daniel-GrunbergerCA
0cac7cb1a5 fix kubeletcmd for marshalling 2021-12-21 09:23:38 +02:00
David Wertenteil
8d41d11ca3 Merge pull request #275 from dwertent/master
CLI improvements
2021-12-20 18:26:55 +02:00
dwertent
0ef516d147 support printing sensor and cloud resources 2021-12-20 18:22:08 +02:00
dwertent
f57a30898c print skipped 2021-12-20 13:32:14 +02:00
dwertent
a10c67555d adding spinner when sending reporting 2021-12-20 11:14:31 +02:00
dwertent
14d0df3926 update generated url 2021-12-20 11:11:31 +02:00
dwertent
c085aeaa68 adding control url to results 2021-12-20 10:53:40 +02:00
David Wertenteil
8543afccca Update objects groping and kinds 2021-12-19 23:34:41 +02:00
dwertent
61b5603a3b support host sensor and cloud descirption 2021-12-19 23:21:05 +02:00
dwertent
e3efffb2ec Merge remote-tracking branch 'upstream/dev' 2021-12-19 15:07:48 +02:00
dwertent
fe9a342b42 update submit testing 2021-12-19 15:06:30 +02:00
Rotem Refael
c7668b4436 Merge pull request #272 from LiorAlafiArmo/dev
ARMO risk-score
2021-12-16 14:33:53 +02:00
Rotem Refael
ccdf6b227f Merge pull request #271 from LiorAlafiArmo/master
ARMO risk-score
2021-12-16 14:32:13 +02:00
Lior Alafi
0aea384f41 changed prettyprint to work with risk-score 2021-12-15 19:04:40 +02:00
Lior Alafi
467059cd26 adding score 2021-12-15 18:13:58 +02:00
David Wertenteil
f41af36ea9 Adding cloudSupport objects to interface 2021-12-14 20:10:45 +02:00
dwertent
e2f8902222 use objectsenvelopes pkg 2021-12-14 20:06:38 +02:00
David Wertenteil
52bfd4cadc Submit configmap and env vars keys 2021-12-14 18:13:42 +02:00
Daniel-GrunbergerCA
7cdc556292 go mod 2021-12-14 14:16:50 +02:00
Daniel-GrunbergerCA
039bda9eaf Merge remote-tracking branch 'upstream/dev' into send_keys 2021-12-14 14:05:13 +02:00
Daniel-GrunbergerCA
a6d73d6f8b ssend keys for configmaps and env vars 2021-12-14 14:05:07 +02:00
Ben Hirschberg
8e5af59153 Merge pull request #267 from armosec/dev
Hot fix - Download command
2021-12-14 12:16:24 +02:00
dwertent
278467518e call SetRegoObjects when downloading 2021-12-14 12:07:07 +02:00
dwertent
a7080a5778 remove data from resource after saving in list 2021-12-14 11:33:33 +02:00
Daniel-GrunbergerCA
6a71ef6745 Merge remote-tracking branch 'upstream/dev' 2021-12-13 15:44:44 +02:00
Rotem Refael
10eb576260 Merge pull request #264 from armosec/dev
Hot fix - all resource list missing some of the failed resources
2021-12-13 14:35:26 +02:00
David Wertenteil
f14acb79bf Merge pull request #263 from dwertent/master
Hot fix - adding failed resources to the all-list of resources
2021-12-13 14:18:55 +02:00
dwertent
b8e011bd27 Merge remote-tracking branch 'upstream/dev' 2021-12-13 14:06:23 +02:00
dwertent
f6295308cd hot-fix eks failing resources 2021-12-13 14:06:07 +02:00
Rotem Refael
f981675850 Merge pull request #262 from armosec/dev
New features and bug fixing - new release
2021-12-12 18:06:25 +02:00
dwertent
93bb7610e6 update summary table 2021-12-12 17:43:34 +02:00
Rotem Refael
23975ee359 change dev-ui link 2021-12-12 13:50:06 +02:00
David Wertenteil
14eaedf375 revert prometheus output
* Revert prometheus output
* Revert sensor behavior
2021-12-12 11:37:50 +02:00
dwertent
ced0b741b9 Do not ask user about host sensor 2021-12-12 11:36:35 +02:00
dwertent
13e805b213 remove passed resources 2021-12-12 10:50:22 +02:00
dwertent
c424c1e394 revert prometheus output 2021-12-12 10:41:09 +02:00
David Wertenteil
77d68bdc73 version and submit improvements 2021-12-09 15:10:50 +02:00
dwertent
a1555bb9cd after merge with dev branch 2021-12-09 14:10:44 +02:00
dwertent
3ca61b218e execute the ResourceEnumerator 2021-12-09 13:41:19 +02:00
dwertent
e7917277e7 move rbac objects to cautils 2021-12-09 13:27:23 +02:00
dwertent
aa18be17fa remove rego from armo, support release fallback 2021-12-09 11:54:25 +02:00
Daniel-GrunbergerCA
39c7af5f8d Merge remote-tracking branch 'upstream/dev' 2021-12-08 13:36:51 +02:00
David Wertenteil
a5f7f8bbe4 Merge pull request #258 from Bezbran/dev
take nodes list from corev1 API.
2021-12-08 11:04:20 +02:00
Bezalel Brandwine
420e491963 add some more host sensor data 2021-12-08 08:58:07 +02:00
Bezbran
36f2ff997a Merge pull request #13 from armosec/dev
Dev
2021-12-08 08:44:04 +02:00
YiscahLevySilas1
c33807d052 Merge pull request #257 from YiscahLevySilas1/dev
add apiVersion to rbac obj
2021-12-07 20:13:00 +02:00
yiscah
fb3946b64f Merge branch 'dev' of https://github.com/YiscahLevySilas1/kubescape into dev 2021-12-07 19:50:31 +02:00
yiscah
51322e7270 add apiVersion to rbac objs 2021-12-07 19:50:14 +02:00
David Wertenteil
3f084d8525 Merge pull request #256 from dwertent/master
* Fixed url scanning 
* Support preRun rego
2021-12-07 17:15:06 +02:00
David Wertenteil
b1f4002036 Merge pull request #255 from AlexsJones/dev
spelling mistake on clihandler/cmd/control.go:19
2021-12-07 16:51:15 +02:00
dwertent
bb1cbe0902 fixed url scanning, support preRun rego 2021-12-07 16:50:43 +02:00
Alex Jones
a095634755 spelling mistake on clihandler/cmd/control.go:19 2021-12-07 13:03:44 +00:00
Daniel-GrunbergerCA
1b9ff074af run workflow 2021-12-07 14:51:34 +02:00
Daniel-GrunbergerCA
f8361446a4 integrate cloud provider description 2021-12-07 14:49:56 +02:00
Bezalel Brandwine
5713490f14 Merge branch 'dev' of github.com:Bezbran/kubescape into dev 2021-12-07 12:48:51 +02:00
Bezalel Brandwine
1ceac2a0a0 take node list from core v1 2021-12-07 12:48:45 +02:00
Daniel-GrunbergerCA
8a2967a0db Merge remote-tracking branch 'upstream/dev' 2021-12-07 10:49:23 +02:00
David Wertenteil
86297720d5 Merge pull request #254 from dwertent/master
store data only once
2021-12-07 10:33:15 +02:00
dwertent
1aeb2b96e2 store data only once 2021-12-07 10:30:03 +02:00
Bezbran
4ee8b9d7f6 Merge pull request #12 from armosec/dev
Dev
2021-12-06 10:18:33 +02:00
David Wertenteil
1d208ed5ec Merge pull request #252 from Bezbran/dev
Merge host-sensor capability
2021-12-05 17:32:57 +02:00
Bezalel Brandwine
3883aaabab fault tolerence for host sensor installing failures 2021-12-05 16:01:38 +02:00
Bezalel Brandwine
6fb3c070d0 dont print skipping node scanning 2021-12-05 15:42:07 +02:00
Bezalel Brandwine
d8d8b4ed73 add k8s resources map all in all to all resources report 2021-12-05 15:40:21 +02:00
David Wertenteil
907f46769f Merge pull request #251 from dwertent/master
return list of strings
2021-12-05 15:14:31 +02:00
dwertent
1ffdb717f7 return list of string 2021-12-05 15:11:44 +02:00
Bezalel Brandwine
9080603bce integrate host sensor into k8s IMetadata resource map 2021-12-05 15:08:05 +02:00
David Wertenteil
5796ae9084 supporting list of include-namespaces
Fixed issue #247
2021-12-05 13:54:23 +02:00
dwertent
50636e3a7e supporting list of include-namespaces 2021-12-05 13:52:06 +02:00
David Wertenteil
501d4c9dfc Update k8s-interface version 2021-12-05 13:12:46 +02:00
dwertent
84cbc4ae04 Update verswion 2021-12-05 12:42:07 +02:00
Bezalel Brandwine
cbb2a3e46f go get + build after merge from armosec 2021-12-05 12:28:28 +02:00
Bezbran
493197c073 Merge pull request #11 from armosec/dev
Dev
2021-12-05 12:24:29 +02:00
Bezbran
31a2952101 Merge branch 'dev' into dev 2021-12-05 12:24:10 +02:00
Bezalel Brandwine
acaccc23e8 merge conflicts 1 2021-12-05 12:15:55 +02:00
David Wertenteil
70e339164d Separate offline behavior from yaml input 2021-12-05 09:57:54 +02:00
dwertent
0de5d72d75 Merge remote-tracking branch 'upstream/dev' 2021-12-05 09:54:57 +02:00
dwertent
d604cc7faf update k8sinterface version 2021-12-05 09:50:56 +02:00
dwertent
d843a3e359 set tenant if config not found 2021-12-02 19:18:35 +02:00
dwertent
37586662b3 handle yaml files and armo api behavior 2021-12-02 19:13:05 +02:00
David Wertenteil
193687418f RBAC object sent using pagination mechanism 2021-12-02 10:13:04 +02:00
yiscah
72e6bb9537 send rbac objs in all resources 2021-12-01 21:30:04 +02:00
David Wertenteil
d69e790c61 Supporting verbose flag 2021-12-01 14:49:53 +02:00
dwertent
01d41520d4 initialize mock resourceMap when scanning yamls 2021-12-01 14:12:00 +02:00
dwertent
aea9eb9e01 use mapResource mock when testing 2021-12-01 12:35:09 +02:00
dwertent
26717b13e9 supporing verbose flag 2021-12-01 12:30:16 +02:00
dwertent
5f36417bd9 update ver 2021-11-30 17:06:20 +02:00
dwertent
021ea34814 update k8s package 2021-11-30 15:47:56 +02:00
David Wertenteil
4a08fbdf28 Adding pagination to report 2021-11-30 10:59:30 +02:00
dwertent
268753091d fixed test 2021-11-30 10:49:05 +02:00
dwertent
ec688829b5 support report pagination 2021-11-29 17:24:50 +02:00
Rotem Refael
ec5bf58b0f Merge pull request #242 from YiscahLevySilas1/dev
add comment for isRuleKubescapeVersionCompatible()
2021-11-29 13:06:05 +02:00
Bezalel Brandwine
f877d821f0 in the middle of refactoring 2021-11-28 16:47:44 +02:00
Bezalel Brandwine
6c22cfef1e in the middle of refactoring 2021-11-28 16:47:24 +02:00
Bezalel Brandwine
05305d858b host sensor flag + user input asking 2021-11-28 12:35:21 +02:00
yiscah
e094237bbf add comment for isRuleKubescapeVersionCompatible() 2021-11-28 10:23:47 +02:00
David Wertenteil
77eb52bc51 Working with IMetadata interface 2021-11-28 08:14:00 +02:00
dwertent
c79834cec7 working with IMetadata interface 2021-11-26 00:52:03 +02:00
Bezalel Brandwine
aefc5fded7 kubelet configuration is in kubescape 2021-11-25 17:54:26 +02:00
Bezalel Brandwine
5fd5a5d4fa [host-sensor] first integration in kubescape 2021-11-25 17:43:21 +02:00
David Wertenteil
0368ecf7f3 External object support
* Aggregate rego input
* Display `User` and `Group` in output
* Update dependencies
2021-11-25 14:33:28 +02:00
yiscah
d9ec5dcb56 rule version - kubescape version check 2021-11-25 12:30:02 +02:00
yiscah
030bc6c6b6 handle pretty print external objects 2021-11-25 12:29:05 +02:00
yiscah
c1dd2fe0f4 print warning in local build to work with latest version 2021-11-25 12:27:28 +02:00
Bezalel Brandwine
4e0851868e initial host sensor deployment stage 2021-11-24 15:23:50 +02:00
Bezbran
276178c27c Merge pull request #10 from armosec/dev
Dev
2021-11-23 10:53:41 +02:00
yiscah
3006e6bcbf add isKindToBeGrouped 2021-11-23 09:07:37 +02:00
yiscah
3a50c5686e print externalObjects with their relatedObjects 2021-11-22 20:34:29 +02:00
yiscah
f8eea4d082 use inputaggregator on k8sresources, don't use v0 rules 2021-11-22 11:06:29 +02:00
YiscahLevySilas1
8a42d77990 Merge branch 'armosec:dev' into dev 2021-11-22 11:05:07 +02:00
Rotem Refael
3980d1a9b0 Merge pull request #235 from armosec/dev
* Hot fixes
* Smoke tests
* Update documentation
2021-11-21 10:22:32 +02:00
Rotem Refael
53741ec26e Update README.md 2021-11-21 10:13:31 +02:00
David Wertenteil
c398cf46c9 Comment out policy version check 2021-11-21 09:23:21 +02:00
dwertent
e869ce4a64 comment out policy version check 2021-11-21 08:49:24 +02:00
YiscahLevySilas1
4064be6577 Merge branch 'armosec:dev' into dev 2021-11-18 16:47:58 +02:00
David Wertenteil
1f00cf4151 Fixed stdin support
* Fixed stdin
* Adding smoke tests
2021-11-16 17:30:06 +02:00
dwertent
bae0ca62b8 update smoke testing 2021-11-16 16:03:31 +02:00
dwertent
b7a51a2495 fixed stdin support 2021-11-16 15:57:23 +02:00
Rotem Refael
4f6a3e39d0 Update SAAS link 2021-11-15 21:59:30 +02:00
David Wertenteil
528f6b7402 Fix broken links
#231
2021-11-14 16:42:40 +02:00
David Wertenteil
c252f29e6d Adding basic exceptions documentation
#232 
#80
2021-11-14 14:46:31 +02:00
dwertent
fea84c9652 update opa-utils pkg version 2021-11-14 14:42:10 +02:00
dwertent
9b9940f708 adding exceptions docs 2021-11-14 14:31:53 +02:00
Thibault Le Reste
a34ab17307 fix Kubernetes Hardening Guidance broken links 2021-11-14 13:16:28 +01:00
yiscah
477a3e7263 update nsa url in readme 2021-11-14 08:59:34 +02:00
Rotem Refael
f94c9496df Merge pull request #223 from armosec/dev
Adding features and fixing bugs
2021-11-11 15:08:38 +02:00
lalafi@cyberarmor.io
1c31281b7b add baseScore to controlReport 2021-11-11 13:57:52 +02:00
dwertent
0e5204ecb4 support custom frameworks 2021-11-11 11:15:33 +02:00
David Wertenteil
f3dc6235d7 Merge pull request #225 from Daniel-GrunbergerCA/master
Supporting custom frameworks
2021-11-11 09:43:40 +02:00
Daniel-GrunbergerCA
37cdf1a19e erase repetitive frameworks 2021-11-10 18:57:05 +02:00
Daniel-GrunbergerCA
1fb642c777 scan with custom framework 2021-11-10 18:30:03 +02:00
dwertent
8f791ceb12 Improve readme 2021-11-10 09:38:34 +02:00
dwertent
f40eaa0f56 Merge branch 'dev' 2021-11-10 08:17:51 +02:00
dwertent
cb34d17ba1 fixed merge 2021-11-10 08:01:33 +02:00
dwertent
328ba82007 Merge branch 'master' of github.com:armosec/kubescape 2021-11-10 07:59:05 +02:00
David Wertenteil
010ed1b047 Merge pull request #222 from dwertent/master
Adding json to http headers
2021-11-10 07:55:38 +02:00
dwertent
5a81a77d92 adding json to http headers 2021-11-10 07:53:35 +02:00
David Wertenteil
c7ea10d206 Merge pull request #221 from dwertent/master
Checking latest version
2021-11-09 17:09:01 +02:00
dwertent
a37d00b40a checking latest version 2021-11-09 17:07:06 +02:00
David Wertenteil
0168b768d2 Merge pull request #214 from mboersma/fix-spelling-fail-threshold
Fix spelling in --fail-threshold description
2021-11-09 15:10:17 +02:00
David Wertenteil
9a85b57ba4 Merge pull request #201 from Joibel/fix/spelling
Minor spelling fixes
2021-11-09 15:10:02 +02:00
dwertent
eafece6497 update helm command in readme 2021-11-09 11:18:30 +02:00
dwertent
8f08271664 udpate cronjob configmap 2021-11-09 11:16:13 +02:00
David Wertenteil
da0271e624 Merge pull request #218 from yonahd/helm_chart
Helm chart for kubescape
2021-11-08 13:17:37 +02:00
Yonah Dissen
94f52fb4ac Documentation running using docker 2021-11-08 11:52:04 +02:00
David Wertenteil
524c2922a4 Merge pull request #219 from Daniel-GrunbergerCA/master
Support scanning multiple controls
2021-11-08 11:29:50 +02:00
Daniel-GrunbergerCA
0891d64654 comment to run workflow 2021-11-08 10:48:39 +02:00
Daniel-GrunbergerCA
d1c23f7442 scan multiple controls 2021-11-08 10:39:31 +02:00
Daniel-GrunbergerCA
8cbbe35f24 Merge remote-tracking branch 'upstream/dev' 2021-11-08 08:53:27 +02:00
Yonah Dissen
a21e9d706e small changes in helm chart 2021-11-07 21:23:57 +02:00
Yonah Dissen
57160c4d04 add helm chart to deploy kubescape in cluster 2021-11-07 21:17:45 +02:00
Yonah Dissen
8b46a49e23 add helm chart to deploy kubescape in cluster 2021-11-07 21:09:30 +02:00
David Wertenteil
c11ebb49f7 Merge pull request #217 from dwertent/master
Fixed include namespaces
2021-11-07 13:56:56 +02:00
dwertent
e4c3935a1b fixed include ns 2021-11-07 13:50:46 +02:00
David Wertenteil
ade062fdd3 Merge pull request #216 from dwertent/master
support armoBest framework name
2021-11-07 09:23:27 +02:00
dwertent
b0f6357482 support armoBest 2021-11-07 09:13:51 +02:00
Matt Boersma
38a9c11286 Fix spelling in --fail-threshold description 2021-11-05 10:33:06 -06:00
David Wertenteil
0d95f02e60 Merge pull request #213 from dwertent/master
support include namespaces
2021-11-04 12:09:27 +02:00
dwertent
1c30528eea support include ns 2021-11-04 12:06:34 +02:00
David Wertenteil
d1b116d314 Merge pull request #210 from dwertent/master
Sbumit support
2021-11-03 17:31:23 +02:00
dwertent
9d20fd41a8 fixed rbac submit 2021-11-03 17:28:37 +02:00
dwertent
54648bb973 update opa pkg 2021-11-03 15:28:42 +02:00
dwertent
fc4edb12f9 adding stdout to smoke tests 2021-11-02 18:59:34 +02:00
dwertent
9a1b8d7ce2 support submit 2021-11-02 16:14:09 +02:00
dwertent
6909975503 controls support yaml inputs 2021-11-02 10:14:39 +02:00
David Wertenteil
5d94bd990a Merge pull request #208 from dwertent/master
Adding smoke testing and support inputs for controls
2021-11-01 17:22:31 +02:00
Ben Hirschberg
1b2514e3ec git push origin masterMerge branch 'armosec-master' 2021-11-01 16:02:51 +02:00
Ben Hirschberg
0da4f40b48 merge 2021-11-01 16:02:23 +02:00
dwertent
67c8719f34 adding smoke tests to PR 2021-11-01 14:04:20 +02:00
dwertent
d5b60c6ac8 update config api 2021-11-01 13:52:40 +02:00
dwertent
a99d2e9e26 remove scan 2021-11-01 12:41:54 +02:00
dwertent
5c7d89cb9e use command 2021-11-01 11:55:54 +02:00
dwertent
ae7810f0d3 support input from file 2021-11-01 11:44:07 +02:00
Yonah Dissen
5a90dc46f0 fix version for cli in docker image 2021-11-01 09:17:46 +02:00
Yonah Dissen
294f886588 fix version for cli in docker image 2021-10-31 17:50:55 +02:00
dwertent
17aec665cf updated tests 2021-10-31 15:31:23 +02:00
dwertent
959b25e8b7 adding smoke tests 2021-10-31 15:05:22 +02:00
dwertent
9fd2bf3480 Merge remote-tracking branch 'upstream/dev' 2021-10-31 14:38:36 +02:00
dwertent
7b061a4e51 update opa pkg 2021-10-31 14:38:13 +02:00
David Wertenteil
4fcd89390b Merge pull request #206 from Joibel/feature/prometheus
Add a prometheus output format
2021-10-31 10:57:49 +02:00
dwertent
667ffe9cd3 Merge remote-tracking branch 'prometheus/feature/prometheus' 2021-10-31 08:58:57 +02:00
dwertent
6f4086cd8c Merge branch 'master' of github.com:armosec/kubescape 2021-10-31 08:58:44 +02:00
dwertent
2a45a1a400 support controls input 2021-10-28 16:29:28 +03:00
David Wertenteil
eee201de1e Merge pull request #205 from dwertent/master
Adding cronJob support doc
2021-10-28 11:30:17 +03:00
dwertent
6be24bd22a change repeatedly to periodically 2021-10-28 10:21:25 +03:00
dwertent
ca927dec30 update naming convention 2021-10-28 10:05:30 +03:00
dwertent
3a78ef46a3 Merge remote-tracking branch 'upstream/dev' 2021-10-28 09:40:26 +03:00
David Wertenteil
bdb1cd0905 Merge pull request #199 from Daniel-GrunbergerCA/master
Scan with multiple frameworks/control support
2021-10-28 09:35:07 +03:00
dwertent
ffb556a637 update readme 2021-10-28 09:15:22 +03:00
dwertent
40acfb5e9d Adding cronJob doc 2021-10-28 09:10:37 +03:00
Daniel-GrunbergerCA
de8bcfa0d2 enhance help msgs 2021-10-27 14:44:25 +03:00
Daniel-GrunbergerCA
9439f407da add env var to not check latest release 2021-10-27 13:39:03 +03:00
Daniel-GrunbergerCA
5095e62961 support scanning multiple frameworks from multiple files 2021-10-27 13:02:45 +03:00
Daniel-GrunbergerCA
3301907864 print only one table for controls & enhance help msg 2021-10-27 10:25:26 +03:00
Daniel-GrunbergerCA
151175c40f read single control from framework file 2021-10-27 08:49:40 +03:00
Daniel-GrunbergerCA
234d4fa537 Merge remote-tracking branch 'upstream/dev' 2021-10-27 08:27:21 +03:00
Rotem Refael
f384e8a6e3 Merge pull request #203 from armosec/cluster-name-issue
adopt cluster name (HotFix)
2021-10-26 20:51:42 +03:00
dwertent
66068757e1 update cluster name in mock struct 2021-10-26 20:39:18 +03:00
dwertent
8a7cda5dd1 adopt cluster name 2021-10-26 20:27:33 +03:00
Alan Clucas
8e67104ba4 Add prometheus to readme 2021-10-26 16:23:05 +01:00
Alan Clucas
0c9da9ddc8 Add a prometheus metrics style output
Output per control results and also per object counts

This can lead to running this as a service that prometheus can collect from
2021-10-26 16:19:35 +01:00
Alan Clucas
a5ef6aa126 Minor spelling fixes 2021-10-26 15:19:05 +01:00
Rotem Refael
c133b7a2c2 Merge pull request #191 from armosec/dev
Hot fixes relates to submit & account options
2021-10-26 14:10:23 +03:00
Daniel-GrunbergerCA
a0ca68cc41 update json and junit for multiple frameworks 2021-10-26 13:55:12 +03:00
Daniel-GrunbergerCA
41cae0bc93 Merge remote-tracking branch 'upstream/dev' 2021-10-26 13:23:00 +03:00
David Wertenteil
b4198fde8c Merge pull request #198 from dwertent/master
update pkg tag
2021-10-26 12:28:02 +03:00
dwertent
bd24f35738 update tag 2021-10-26 12:26:44 +03:00
Daniel-GrunbergerCA
6fcbb757b5 Merge remote-tracking branch 'upstream/dev' 2021-10-25 17:41:15 +03:00
Daniel-GrunbergerCA
3b8825e5d2 scan multiple frameworks and controls 2021-10-25 17:41:04 +03:00
Rotem Refael
5cf3244918 Merge pull request #192 from dwertent/master
Update multiple score
2021-10-25 17:40:19 +03:00
dwertent
934c9ccc8b fixed lowest 2021-10-25 15:51:23 +03:00
dwertent
41dfdfd1e8 support more than score 2021-10-25 15:14:31 +03:00
David Wertenteil
427fb59c99 Merge pull request #190 from dwertent/master
Fixed submit and url
2021-10-25 12:08:23 +03:00
David Wertenteil
ae825800f6 Merge pull request #189 from Daniel-GrunbergerCA/master
Update tag for newest release of k8s-interface
2021-10-25 12:08:06 +03:00
dwertent
d72700acf6 update submit 2021-10-25 12:05:51 +03:00
dwertent
3310a6a26f Merge remote-tracking branch 'upstream/dev' 2021-10-25 11:55:30 +03:00
dwertent
740b5aa772 add full url 2021-10-25 11:55:08 +03:00
Daniel-GrunbergerCA
04b55e764a fix k8s-interface pkg tag 2021-10-25 10:44:43 +03:00
Daniel-GrunbergerCA
beb4062bb1 update tag 2021-10-25 09:29:43 +03:00
David Wertenteil
5d4cd4acdc Merge pull request #188 from dwertent/master
Use interfaces
2021-10-25 09:21:43 +03:00
dwertent
aec8198131 adding score to interface 2021-10-25 08:41:15 +03:00
dwertent
0a850e47df use interfaces 2021-10-24 17:51:03 +03:00
Rotem Refael
5544820c5e Merge pull request #187 from armosec/dev
Fixed junit counter
2021-10-21 16:23:09 +03:00
dwertent
4f466d517a fixed junit counter 2021-10-21 16:05:51 +03:00
Bezbran
cd0f20ca2f Merge pull request #9 from armosec/master
Dev
2021-10-21 14:38:17 +03:00
Ben Hirschberg
b3661848dc Merge pull request #186 from armosec/dev
merge readme & install fix
2021-10-21 14:08:57 +03:00
Rotem Refael
548201c256 Merge pull request #185 from dwertent/master
Update readme with new featurs
2021-10-21 13:46:33 +03:00
dwertent
a54e5d9f8b update readme with new featurs 2021-10-21 13:25:41 +03:00
dwertent
536257afa1 fixed version in build.py 2021-10-21 12:48:52 +03:00
dwertent
5a71c3270a Merge branch 'master' of github.com:armosec/kubescape 2021-10-21 11:32:40 +03:00
dwertent
d194dd173f fixed image and entrypoint 2021-10-21 11:32:20 +03:00
Ben Hirschberg
be03a9e984 Merge pull request #173 from armosec/dev
Dev
2021-10-21 10:33:26 +03:00
dwertent
a90177e7c0 update go mod file 2021-10-21 09:56:05 +03:00
Rotem Refael
be9e8ca47d Merge pull request #184 from Daniel-GrunbergerCA/master
Implementing single control scan  (from file and and from regolibrary) & download single control
2021-10-21 08:33:26 +03:00
Daniel-GrunbergerCA
eb9fe85c75 add error handling 2021-10-20 17:45:11 +03:00
Daniel-GrunbergerCA
47183c405f add some comments 2021-10-20 17:29:25 +03:00
Daniel-GrunbergerCA
2725923b9b case insensitive 2021-10-20 16:58:09 +03:00
Daniel-GrunbergerCA
f6c03ed7a2 fix offline support 2021-10-20 16:50:59 +03:00
Daniel-GrunbergerCA
76b5548216 Merge remote-tracking branch 'upstream/dev' 2021-10-20 16:29:56 +03:00
Daniel-GrunbergerCA
cc57a34a32 run control scan form file 2021-10-20 16:18:53 +03:00
Bezbran
f7099b62e6 Merge pull request #182 from Bezbran/dev
Add API version to report structure
2021-10-20 16:05:46 +03:00
Bezalel Brandwine
093ee8916e Add API version to report structure 2021-10-20 16:04:10 +03:00
David Wertenteil
ac0259157b Merge pull request #181 from dwertent/master
Update junit results
2021-10-20 15:57:34 +03:00
dwertent
9cb937798f update readme 2021-10-20 14:53:19 +03:00
dwertent
11d4926c85 updte junit results 2021-10-20 14:49:27 +03:00
Daniel-GrunbergerCA
836211ae2b update go mod 2021-10-20 14:39:33 +03:00
Daniel-GrunbergerCA
fddf3d3f58 Merge remote-tracking branch 'upstream/dev' 2021-10-20 14:15:46 +03:00
Daniel-GrunbergerCA
b036d1079e support control scan with new api 2021-10-20 14:15:27 +03:00
Rotem Refael
137c39e918 Merge pull request #180 from AvnerTzurArmo/dev
add cronjob sample for kubescape
2021-10-20 13:57:26 +03:00
Avner Tzur
8778d022cf add cronjob sample for kubescape 2021-10-20 10:59:30 +03:00
Bezbran
043bdbacec Merge pull request #8 from armosec/dev
Dev
2021-10-20 10:49:28 +03:00
Daniel-GrunbergerCA
e0e19b0258 Merge remote-tracking branch 'upstream/dev' 2021-10-20 09:05:37 +03:00
David Wertenteil
c72e0f790a Merge pull request #179 from dwertent/master
fallback get customer guid from configMap
2021-10-19 16:30:47 +03:00
dwertent
87e79110a2 fallback customer guid from configMap 2021-10-19 16:25:54 +03:00
David Wertenteil
faeae1af60 Merge pull request #178 from dwertent/master
adding summary changes
2021-10-19 15:09:05 +03:00
dwertent
b371fbad01 adding summary 2021-10-19 15:08:00 +03:00
David Wertenteil
90831e153d Merge pull request #177 from dwertent/master
Distinct exclude and failed resources
2021-10-19 14:24:10 +03:00
dwertent
009d8275c1 Distinct exclude and failed resources 2021-10-19 14:22:09 +03:00
Daniel-GrunbergerCA
05c88e0ffc Merge remote-tracking branch 'upstream/dev' 2021-10-18 17:40:11 +03:00
Daniel-GrunbergerCA
7d12552932 add option to run single control 2021-10-18 17:39:35 +03:00
Rotem Refael
b761505bb1 Merge pull request #172 from Moshe-Rappaport-CA/master
Support scanning yamls from gitHub repo
2021-10-18 14:51:42 +03:00
moshep
63367f4f31 support yamls from repo 2021-10-18 14:29:44 +03:00
Rotem Refael
6f9d6b4af3 Update README.md 2021-10-18 14:16:29 +03:00
Rotem Refael
6ed8287b01 Update README.md 2021-10-18 14:15:45 +03:00
Rotem Refael
d948e20682 Change readme text 2021-10-18 14:12:57 +03:00
Rotem Refael
42929dac58 Merge pull request #171 from armosec/dev
Fix workflow for building image
2021-10-18 11:59:29 +03:00
Rotem Refael
74449c64a2 Merge pull request #170 from Daniel-GrunbergerCA/master
Fix env var name
2021-10-18 11:26:18 +03:00
Daniel-GrunbergerCA
0bd164c69e fix workflow for dev 2021-10-18 11:15:55 +03:00
Daniel-GrunbergerCA
d44c082134 fix env var name 2021-10-18 11:11:32 +03:00
Daniel-GrunbergerCA
d756b9bfe4 check repo name 2021-10-18 11:04:57 +03:00
Daniel-GrunbergerCA
6144050212 echo repo 2021-10-18 11:02:54 +03:00
Daniel-GrunbergerCA
b5fe456b0d fix test 2021-10-18 10:59:41 +03:00
Daniel-GrunbergerCA
37791ff391 testing workflow output 2021-10-18 10:57:04 +03:00
Daniel-GrunbergerCA
c2d99163a6 test output for workflow 2021-10-18 10:55:13 +03:00
Daniel-GrunbergerCA
d948353b99 test env var output for build 2021-10-18 10:51:50 +03:00
Daniel-GrunbergerCA
2649cb75f6 Revert "check env var output"
This reverts commit 7c8da4a4b9.
2021-10-18 10:51:28 +03:00
Daniel-GrunbergerCA
7c8da4a4b9 check env var output 2021-10-18 10:49:53 +03:00
Rotem Refael
b72f5d75f7 Merge pull request #167 from armosec/dev
Update resource count
2021-10-18 10:34:45 +03:00
Rotem Refael
947826a764 Merge pull request #168 from Daniel-GrunbergerCA/master
Build docker image only for original repo (not for forks)
2021-10-18 10:31:22 +03:00
David Wertenteil
906c69a86d Merge pull request #169 from armosec/rotemamsa-patch-1
Delete backendconnectormethods.go
2021-10-18 10:28:19 +03:00
Rotem Refael
9c65aadcc7 Delete backendconnectormethods.go 2021-10-18 10:26:59 +03:00
dwertent
70a9a7bbbd Update resource count 2021-10-18 10:23:06 +03:00
Daniel-GrunbergerCA
09879e00ba build image only for original repo 2021-10-18 10:14:42 +03:00
Daniel-GrunbergerCA
5cbb7d940d Revert "fix build again"
This reverts commit 050976d7a3.
2021-10-18 10:12:42 +03:00
Daniel-GrunbergerCA
050976d7a3 fix build again 2021-10-18 10:05:58 +03:00
Daniel-GrunbergerCA
6a96d9f8b5 fix build 2021-10-18 09:59:03 +03:00
Daniel-GrunbergerCA
8c55dfbcf6 fix workflow 2021-10-18 09:52:26 +03:00
Daniel-GrunbergerCA
78c5b49b5a create image only for original repo 2021-10-18 09:49:50 +03:00
dwertent
c33ca04a4f update dev build workflow 2021-10-18 09:06:14 +03:00
David Wertenteil
f12e66d315 Merge pull request #166 from dwertent/master
update package version
2021-10-18 09:02:25 +03:00
David Wertenteil
8e4bb36df8 Merge pull request #165 from AvnerTzurArmo/dev
Add Docker image builds
2021-10-18 09:00:27 +03:00
dwertent
034412f6fe update package version 2021-10-18 08:59:41 +03:00
Avner Tzur
88d83ba72d fix typo 2021-10-18 08:26:15 +03:00
Avner Tzur
829e7a33aa fix typo 2021-10-18 08:25:25 +03:00
Avner Tzur
1dcde1538e fix typo 2021-10-17 16:50:59 +03:00
Avner Tzur
b876cd0975 use armosec repo name 2021-10-17 16:49:01 +03:00
Avner Tzur
a06d11dc17 fix repo env usage 2021-10-17 16:38:00 +03:00
Avner Tzur
b1f5cd45c4 use repo as secret 2021-10-17 16:13:54 +03:00
Avner Tzur
2c44c0e1f0 fix Docker build and tags 2021-10-17 15:59:47 +03:00
Avner Tzur
37c429b264 add Docker container build 2021-10-17 15:55:06 +03:00
Avner Tzur
82994ce754 fix typo 2021-10-17 15:43:38 +03:00
Avner Tzur
621f64c363 fix image name 2021-10-17 15:25:50 +03:00
Benyamin Hirschberg
5591bf09d9 Merge branch 'armosec-master' 2021-10-15 22:24:04 +03:00
Benyamin Hirschberg
da94651656 merged original armosec 2021-10-15 22:23:47 +03:00
David Wertenteil
419a77f144 Merge pull request #164 from dwertent/master
using public packages
2021-10-14 17:36:37 +03:00
dwertent
f043358a59 merging to dev 2021-10-14 17:32:56 +03:00
dwertent
24b17a8c27 update counters 2021-10-14 17:12:10 +03:00
Rotem Refael
26a64b788b Merge pull request #163 from AvnerTzurArmo/dev
update Dockerfile using Python build script
2021-10-14 15:54:56 +03:00
Rotem Refael
89a05d247b Merge pull request #159 from armosec/dev
test help message after build
2021-10-14 15:43:28 +03:00
Avner Tzur
718d549bb3 update Dockerfile using Python build script 2021-10-14 15:23:35 +03:00
Bezbran
54a6a8324a Merge pull request #7 from armosec/dev
Dev
2021-10-14 14:54:14 +03:00
Bezbran
7faf24cf88 build python3 --version && python3 build.py 2021-10-14 14:48:47 +03:00
Bezbran
7bebc7a814 master PR python 3 for build 2021-10-14 14:48:16 +03:00
Bezbran
8647a087dd Merge pull request #162 from Bezbran/dev
python3 for build
2021-10-14 14:40:25 +03:00
Bezalel Brandwine
78670665c4 build.py support only pthon 3.7 and above 2021-10-14 14:39:43 +03:00
Bezalel Brandwine
1dd587cd83 try python3 2021-10-14 14:30:58 +03:00
Bezalel Brandwine
d69cccf821 print python version 2021-10-14 14:24:49 +03:00
Bezbran
8ae3b9c28f Merge pull request #161 from Bezbran/dev
adapt test_cli_prints to windows
2021-10-14 14:17:42 +03:00
Bezalel Brandwine
9b6ad102b1 adapt test_cli_prints to windows 2021-10-14 14:16:12 +03:00
Bezbran
e6787b77fb Merge pull request #160 from Bezbran/dev
files tests passed locally on windows
2021-10-14 14:10:35 +03:00
Bezalel Brandwine
46449045a6 files tests passed locally on windows 2021-10-14 14:04:55 +03:00
Bezalel Brandwine
d81984b4c6 try to adapt path to windows 2021-10-14 13:28:10 +03:00
Bezbran
22b463f306 Merge pull request #158 from Bezbran/dev
test help message after build
2021-10-14 12:13:32 +03:00
Bezalel Brandwine
475e45b848 add CLI prints checks skeleton 2021-10-14 12:07:51 +03:00
Rotem Refael
32fac97d21 Merge pull request #157 from armosec/dev
fix  --help flag
2021-10-14 11:47:22 +03:00
Bezalel Brandwine
f9f32a1062 comment in file loading tests 2021-10-14 11:43:11 +03:00
Bezbran
c90c3bbd05 test help message 2021-10-14 11:32:59 +03:00
dwertent
ea42d9a061 remove exceptions from pkg 2021-10-14 11:25:53 +03:00
Bezbran
cbae9a087b Merge pull request #6 from armosec/dev
Dev
2021-10-14 10:56:39 +03:00
Bezbran
4da199c43e Merge pull request #156 from Bezbran/dev
fix  --help flag
2021-10-14 10:55:43 +03:00
Bezalel Brandwine
00d8660a91 fix --help flag 2021-10-14 10:46:42 +03:00
Rotem Refael
76c2f6afe0 Merge pull request #155 from armosec/dev
Fixed #148
2021-10-14 10:20:35 +03:00
dwertent
efa53bd83c fixed loop 2021-10-14 09:13:07 +03:00
dwertent
01f6a1e1c0 fixed counters 2021-10-13 20:41:30 +03:00
dwertent
1d1344ebc1 fixed warning counter 2021-10-13 20:33:26 +03:00
Rotem Refael
9f78703dee Merge pull request #154 from armosec/dev
Support in --environment
2021-10-13 17:05:52 +03:00
Bezbran
1a0e96338e Merge pull request #5 from armosec/dev
Merge back pull request #153 from Bezbran/dev
2021-10-13 16:58:31 +03:00
Bezbran
eff4690e0e Merge pull request #153 from Bezbran/dev
add support in --environment=dev or customized URLs
2021-10-13 16:57:39 +03:00
Bezbran
266480c234 Merge branch 'dev' into dev 2021-10-13 16:57:14 +03:00
Bezalel Brandwine
a922d01005 add support in --environment=dev or customized URLs 2021-10-13 16:45:06 +03:00
dwertent
b053b84197 use packets 2021-10-13 15:56:43 +03:00
David Wertenteil
0d9711c8bb Merge pull request #151 from armosec/dev
Fixed issues
2021-10-13 13:02:52 +03:00
David Wertenteil
edab68f4fb Merge pull request #152 from Bezbran/dev
fix download framework command
2021-10-13 12:35:26 +03:00
Bezalel Brandwine
08f04e19ef fix download framework (create dir if necessary, lower case "download") 2021-10-13 12:24:21 +03:00
David Wertenteil
e62234a6ac Merge pull request #150 from dwertent/master
Fixed issues #149 #76
2021-10-13 12:07:12 +03:00
dwertent
5499c7a96f fixed #149 2021-10-13 12:03:57 +03:00
dwertent
7f9c5c25ae fixed #76 2021-10-13 11:58:22 +03:00
Bezbran
b1276d56f7 Merge pull request #4 from armosec/dev
Dev
2021-10-13 09:11:24 +03:00
Rotem Refael
b53bf320a6 Merge pull request #141 from armosec/dev
Update default upload of results to be opt-in
2021-10-12 18:31:16 +03:00
Daniel Grunberger
81a4c168ed Merge pull request #147 from Daniel-GrunbergerCA/master
fix warning numbers of resources
2021-10-12 18:13:51 +03:00
Daniel-GrunbergerCA
512a1a806e fix warning numbers of resources 2021-10-12 18:12:49 +03:00
David Wertenteil
c95ef05177 Merge pull request #146 from dwertent/master
update flag to keep-local
2021-10-12 18:06:02 +03:00
Daniel Grunberger
563bd8a6a3 Merge pull request #145 from Daniel-GrunbergerCA/master
fix number of resources
2021-10-12 17:41:48 +03:00
dwertent
b444542f4d update flag to keep-local 2021-10-12 17:40:56 +03:00
Daniel-GrunbergerCA
6eded41eee fix number of resources 2021-10-12 17:08:03 +03:00
YiscahLevySilas1
de91ce182d Merge pull request #144 from YiscahLevySilas1/dev
add controlID field, 'id' to be deprecated
2021-10-12 15:07:10 +03:00
dwertent
afc7f85460 adding demo link to readme 2021-10-12 12:39:26 +03:00
yiscah
c1b4d7de39 add controlID field, 'id' to be deprecated 2021-10-12 10:48:46 +03:00
dwertent
cde5b83bca update summary 2021-10-12 10:26:30 +03:00
Bezbran
f00106a502 Merge pull request #143 from Bezbran/dev
Run release workflow just for merged PRs to master
2021-10-12 10:17:26 +03:00
Bezalel Brandwine
3ae2742717 rmove workflow dependency 2021-10-12 10:05:55 +03:00
David Wertenteil
8deac19945 Merge pull request #142 from dwertent/master
Update default unregistered behavior
2021-10-12 10:00:46 +03:00
dwertent
2ad469a5f4 update summary image 2021-10-12 09:57:46 +03:00
dwertent
c67b111c77 do not submit unregisred user 2021-10-12 09:51:14 +03:00
Bezalel Brandwine
ee770e7429 add github actions workflow for opened PRs to master 2021-10-12 09:49:26 +03:00
Bezalel Brandwine
197a3adf6a trigger release only for push to master to avoid release on closed PRs without merging 2021-10-12 09:38:52 +03:00
Bezbran
269d39497b Merge pull request #1 from armosec/dev
Dev
2021-10-12 09:29:28 +03:00
David Wertenteil
0c3a7ac02b Merge pull request #140 from dwertent/master
split setCustomer func
2021-10-12 08:10:02 +03:00
dwertent
07443548c9 split setCustomer func 2021-10-12 07:59:41 +03:00
Ben Hirschberg
e561f78ada Merge pull request #133 from clfs/clfs/bugfixes
Add missing return
2021-10-11 23:22:29 +03:00
Ben Hirschberg
bb88272251 Merge pull request #129 from ferhaty/dev
removed references to go mod tidy
2021-10-11 23:21:08 +03:00
Ferhat Yildiz
ce2f3dafae removed references to go mod tidy since there is a go.sum file now 2021-10-11 17:02:21 +02:00
David Wertenteil
488c67056c Merge pull request #138 from dwertent/master
Update readme
2021-10-11 16:32:25 +03:00
dwertent
351e51208d Merge remote-tracking branch 'upstream/dev' 2021-10-11 16:29:43 +03:00
dwertent
0c79df7299 restore id after local run, update readme 2021-10-11 16:29:26 +03:00
David Wertenteil
b9a5c5af35 Merge pull request #137 from dwertent/master
Update default upload of results to be opt-in
2021-10-11 15:04:07 +03:00
dwertent
59741b84d1 Update default upload of results to be opt-in 2021-10-11 15:00:23 +03:00
David Wertenteil
25efcdf750 Merge pull request #135 from Daniel-GrunbergerCA/master
Improve help msgs
2021-10-10 18:50:46 +03:00
Daniel-GrunbergerCA
49dfa6c2a6 Merge remote-tracking branch 'upstream/dev' 2021-10-10 15:50:44 +03:00
Daniel-GrunbergerCA
659647353e fix return code in help msg 2021-10-10 15:43:08 +03:00
Daniel-GrunbergerCA
0eba51c80b beautify help msgs 2021-10-10 14:38:14 +03:00
David Wertenteil
35996d11f4 Merge pull request #134 from Daniel-GrunbergerCA/master
fix TestConvertLabelsToString test
2021-10-10 14:06:03 +03:00
Daniel-GrunbergerCA
e0e0a811eb Add supported frameworks to help msg 2021-10-10 14:01:35 +03:00
Daniel-GrunbergerCA
76f400d0aa fix TestConvertLabelsToString test 2021-10-10 13:06:51 +03:00
Calvin Figuereo-Supraner
8e950e0f54 Add missing return 2021-10-09 21:25:01 -07:00
Rotem Refael
0adb9dd540 Merge pull request #126 from armosec/dev 2021-10-07 19:18:10 +03:00
David Wertenteil
5825555534 Merge pull request #127 from dwertent/master
Adding unittest to workflow
2021-10-07 18:24:56 +03:00
dwertent
306a8c6201 Merge remote-tracking branch 'upstream/dev' 2021-10-07 18:19:00 +03:00
dwertent
123b620085 Merge branch 'master' of github.com:armosec/kubescape into dev 2021-10-07 18:14:29 +03:00
dwertent
831e7814be ignore files 2021-10-07 18:12:21 +03:00
Ben Hirschberg
7c85199ac2 Merge pull request #106 from Juneezee/go1.17
build: upgrade to Go 1.17
2021-10-07 18:05:42 +03:00
dwertent
efec8e4f2f adding unittest to workflow 2021-10-07 18:02:44 +03:00
Avner Tzur
af4faef9cf Add macOS brew installation 2021-10-07 17:30:12 +03:00
dwertent
90052ad9e3 Merge branch 'master' of github.com:armosec/kubescape into dev 2021-10-07 15:46:50 +03:00
Rotem Refael
35c7b16e4a Update build.yaml
change report link
2021-10-07 15:18:37 +03:00
David Wertenteil
7ac75acfc2 Merge pull request #125 from dwertent/master
Update display color
2021-10-07 15:11:43 +03:00
dwertent
22662fddcd update display color 2021-10-07 15:03:48 +03:00
David Wertenteil
6df1cdf5d8 Merge pull request #124 from dwertent/master
Changing warning to excluded in results
2021-10-07 14:00:19 +03:00
dwertent
2287c51d73 changing warning to excluded 2021-10-07 13:59:20 +03:00
David Wertenteil
372942a14f Merge pull request #122 from dwertent/master
Adding go sum
2021-10-07 10:18:23 +03:00
dwertent
6362246da4 Merge remote-tracking branch 'upstream/dev' 2021-10-07 10:11:41 +03:00
dwertent
9986d69215 adding go sum 2021-10-07 10:11:14 +03:00
Eng Zer Jun
21644e5cba refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-07 00:23:09 +08:00
Eng Zer Jun
ad93217bf6 build: upgrade to Go 1.17
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-07 00:23:04 +08:00
Ben Hirschberg
ca49bc1ddd Merge pull request #121 from armosec/dev
Fixed issues, update windows support
2021-10-06 18:20:37 +03:00
David Wertenteil
1229c73ddc Merge pull request #120 from dwertent/master
Fixing exception cluster name support
2021-10-06 18:16:51 +03:00
dwertent
7416202555 adding mitre example 2021-10-06 18:14:24 +03:00
dwertent
a0ba683eea Merge remote-tracking branch 'upstream/dev' 2021-10-06 18:12:48 +03:00
dwertent
89654eb26f update exception cluster name compare 2021-10-06 18:12:33 +03:00
Bezbran
9d1736a141 Typo in readme built.py -->> build.py 2021-10-06 15:22:38 +03:00
David Wertenteil
eaa4ed3da5 Merge pull request #118 from xdavidel/master
Update windows support in build
2021-10-06 15:10:02 +03:00
David Delarosa
0db3f65312 Merge remote-tracking branch 'upstream/dev' 2021-10-06 15:05:07 +03:00
David Wertenteil
1ea0a3ccc5 Merge pull request #117 from dwertent/master
load configMap configuration before file configuration
2021-10-06 14:24:30 +03:00
dwertent
16cd30bea8 load configMap before file 2021-10-06 14:06:36 +03:00
David Delarosa
075ba4c603 Comment out this windows exe
The build workflow relay on the same binary name - so we won't change
that right now.
2021-10-06 11:23:56 +03:00
David Delarosa
2d898822df Merge branch 'dev-win' 2021-10-06 10:36:11 +03:00
David Delarosa
25b8ec82e8 Cannot use both 'uses' and 'run' 2021-10-06 10:21:29 +03:00
David Delarosa
44b74e2681 Change workflow to use build.py script 2021-10-05 17:28:38 +03:00
David Wertenteil
485e171008 Merge pull request #116 from dwertent/master
Revert python script build
2021-10-05 17:17:13 +03:00
dwertent
c12eb83b4b remove comment 2021-10-05 17:12:43 +03:00
dwertent
84060e7823 revert python build 2021-10-05 17:07:30 +03:00
David Wertenteil
d80d50b59d Merge pull request #115 from dwertent/master
fixed in cluster crash - #114
2021-10-05 16:56:00 +03:00
dwertent
f11f054fea offline not new feature 2021-10-05 16:51:03 +03:00
dwertent
4c1d491d5a Merge remote-tracking branch 'upstream/dev' 2021-10-05 16:43:54 +03:00
dwertent
2b67cc520c windows install support 2021-10-05 16:43:05 +03:00
dwertent
2a5712bd3c fixed in cluster crash 2021-10-05 16:11:41 +03:00
Ben Hirschberg
ccbc11408b Merge pull request #109 from armosec/dev
Update master with fixed issues #95 #96
2021-10-05 09:25:35 +03:00
Bezbran
22bae315be Merge pull request #112 from Bezbran/dev
Add discord using github pages
2021-10-05 09:23:17 +03:00
Bezalel Brandwine
740ab7cb46 point readme discord to github pages 2021-10-05 09:21:58 +03:00
Bezalel Brandwine
cdaa9aa1b0 discord UI beautify 2021-10-05 09:18:39 +03:00
Bezbran
875f82dcbb Merge pull request #4 from armosec/dev
Dev from org
2021-10-05 09:18:03 +03:00
Ben Hirschberg
e8f6bdd64a Merge pull request #108 from YiscahLevySilas1/master
added mitre to supported frameworks
2021-10-04 17:06:00 +03:00
yiscah
25247491ee add mitre to supportedFrameworks, accept upper/lowercase "MITRE" 2021-10-04 16:56:18 +03:00
Ben Hirschberg
57ae3dc3a7 Merge pull request #107 from dwertent/master
Fixed #95, #96
2021-10-04 16:53:48 +03:00
dwertent
27d00b58d7 Adding star to readme, support wild labels 2021-10-04 15:15:18 +03:00
Bezalel Brandwine
263821ce67 landing page in docs dir 2021-10-04 14:57:11 +03:00
Bezalel Brandwine
3c12247b00 add index html as GitHub pages landing page 2021-10-04 14:54:04 +03:00
Bezbran
56d41596f6 Merge pull request #3 from armosec/dev
Dev merge
2021-10-04 14:32:51 +03:00
Avner Tzur
f0cd1965b4 update git repo URL using https 2021-10-04 13:51:47 +03:00
Ben Hirschberg
86b6a1d88a complete zip release and install with hash 2021-10-04 08:36:53 +03:00
Ben Hirschberg
f903e13d7b adding hash to release zip 2021-10-04 08:19:44 +03:00
Ben Hirschberg
015206a760 release id 2021-10-03 22:21:54 +03:00
Ben Hirschberg
0aff119260 fix bad reference 2021-10-03 22:13:00 +03:00
Ben Hirschberg
ddb8608501 moving up the publishing step 2021-10-03 22:11:20 +03:00
Ben Hirschberg
0d75a273f0 post release event 2021-10-03 22:06:27 +03:00
Ben Hirschberg
4f07d23dd6 moving to post release 2021-10-03 21:50:35 +03:00
Ben Hirschberg
79baa0d66e hashing 2021-10-03 21:36:37 +03:00
Ben Hirschberg
d5ca49ef9b removing not needed plugin 2021-10-03 21:23:00 +03:00
Ben Hirschberg
536d7fb3c5 try another release plugin 2021-10-03 21:20:25 +03:00
Ben Hirschberg
f66fd1f38c hash for release 2021-10-03 21:09:53 +03:00
dwertent
3a4c06a818 fixed issue #95 2021-10-03 17:22:50 +03:00
David Wertenteil
fd8dd7ab8a Merge pull request #100 from slashben/master
Adding discord links to readme
2021-10-03 15:26:39 +03:00
Ben Hirschberg
0434f6a935 Merge pull request #99 from taylor/patch-1
Fix link to hardening guide in README
2021-10-03 13:39:05 +03:00
Benyamin Hirschberg
b51a26442c returning examples to the main readme 2021-10-03 09:16:18 +03:00
Benyamin Hirschberg
6462ac0f0e moving options 2021-10-03 09:08:03 +03:00
Benyamin Hirschberg
fc01dbbac9 discord banner 2021-10-03 08:10:29 +03:00
Benyamin Hirschberg
df8576c066 Use a better discord logo 2021-10-03 08:07:42 +03:00
Benyamin Hirschberg
ca8adf28cf Discord invitation 2021-10-03 08:03:17 +03:00
Taylor Carpenter
f70c6c566e Fix link to hardening guide
Signed-off-by: Taylor Carpenter <taylor@vulk.coop>

Updating the link to the Kubernetes Hardening Guidance by NSA and CISA

Ref: https://github.com/armosec/kubescape/issues/97
2021-09-30 10:10:51 -05:00
Benyamin Hirschberg
056d4411b7 Merge pull request #92 from BenHirschbergCa/master
adding CONTRIBUTING.md
2021-09-27 13:55:13 +03:00
Ben Hirschberg
602b83b0e5 adding CONTRIBUTING.md 2021-09-27 13:53:54 +03:00
Benyamin Hirschberg
1cfcc6d930 Merge pull request #90 from BenHirschbergCa/master
installing kubescape in home directory if possible
2021-09-23 21:05:31 +03:00
Ben Hirschberg
8c6f618743 installing kubescape in home directory if possible 2021-09-23 17:54:05 +00:00
Benyamin Hirschberg
6adf1c3162 Merge pull request #88 from BenHirschbergCa/master
Fixing sudo missing issue and returning build without C runtime dependency
2021-09-21 23:59:30 +03:00
Ben Hirschberg
9f5f4f1832 removing useless command in install 2021-09-21 23:48:26 +03:00
Ben Hirschberg
9f49cc83e9 Fixing install.sh to work in environments where there is no sudo && enabling static executable build 2021-09-21 23:45:35 +03:00
Benyamin Hirschberg
67972199ce Merge pull request #86 from armosec/Daniel-GrunbergerCA-patch-1
Update README.md
2021-09-21 23:05:25 +03:00
Daniel Grunberger
9d5db86bf3 Update README.md 2021-09-19 17:42:59 +03:00
Benyamin Hirschberg
39efed5fc1 Merge pull request #85 from armosec/dev
Delivering signup to master
2021-09-19 17:34:31 +03:00
Benyamin Hirschberg
21c2bf22dd Update scaninfo.go 2021-09-19 17:28:46 +03:00
Benyamin Hirschberg
6c94b3a423 Merge branch 'master' into dev 2021-09-19 17:24:14 +03:00
Benyamin Hirschberg
683248db0b Merge pull request #83 from Daniel-GrunbergerCA/master
Finish config local flags
2021-09-19 17:08:56 +03:00
Daniel Grunberger
9032400528 Fix permission denied 2021-09-19 16:19:25 +03:00
Bezbran
1a925b1acf Merge pull request #84 from Bezbran/dev
attributes as lower
2021-09-19 15:09:01 +03:00
Bezalel Brandwine
dadc8c2c60 exception attributes to lower 2021-09-19 15:07:39 +03:00
Daniel-GrunbergerCA
01c1b44bfc finish config local flags 2021-09-19 14:53:04 +03:00
Bezbran
a394a99d8f Merge pull request #2 from armosec/dev
Dev from armosec
2021-09-19 13:39:31 +03:00
Benyamin Hirschberg
4213707b7f Merge pull request #82 from brsolomon-deloitte/bugfix-issue-81-output-ext
Bugfix: correctly compare filepath.Ext() result
2021-09-18 21:26:39 +03:00
Brad Solomon
d53b8272ee Bugfix: correctly compare filepath.Ext() result
Closes #81.

setOutputFile() will incorrectly append .json to an --output
value that already has it. This is because
https://pkg.go.dev/path/filepath#Ext result includes
the ., whereas the current logic only tests against
json, not .json.
2021-09-16 11:57:58 -04:00
Daniel-GrunbergerCA
fdd688ac68 Merge remote-tracking branch 'upstream/dev' 2021-09-14 17:53:35 +03:00
Daniel-GrunbergerCA
5bb961bdc6 start get/set for config.json 2021-09-14 17:53:21 +03:00
Daniel-GrunbergerCA
9e7cc06f97 give higher priority to config.json 2021-09-14 17:14:21 +03:00
Benyamin Hirschberg
1d184d9000 Merge pull request #78 from YiscahLevySilas1/master
remove redundant responses
2021-09-14 16:52:05 +03:00
Benyamin Hirschberg
a5e2ebf647 Update datastructuresmethods.go 2021-09-14 16:51:16 +03:00
Benyamin Hirschberg
29eb573de5 Merge pull request #79 from BenHirschbergCa/dev
Add build for dev branch
2021-09-14 16:49:45 +03:00
Ben Hirschberg
ec6c3da5ec no needs :) 2021-09-14 16:40:12 +03:00
yiscah
e2d4f8961e Merge remote-tracking branch 'upstream/dev' 2021-09-14 16:38:13 +03:00
Ben Hirschberg
a48c680201 build dev branch 2021-09-14 16:36:57 +03:00
yiscah
c869f2c962 append to msg, loop backward on ruleresponses, don't check redundant role/clusterrole k8sresources 2021-09-14 16:36:57 +03:00
Benyamin Hirschberg
f77fc9a06d Merge branch 'armosec:dev' into dev 2021-09-14 16:01:59 +03:00
Daniel Grunberger
e12eae93b9 Merge pull request #77 from Daniel-GrunbergerCA/master
Add  config clsuter & fix github workflow
2021-09-14 15:27:09 +03:00
Daniel-GrunbergerCA
d92fb32574 fix build.yaml 2021-09-14 15:14:26 +03:00
Daniel-GrunbergerCA
541dba3d79 update build.yaml 2021-09-14 15:06:18 +03:00
yiscah
033ed17125 controlReport status is passed only if ALL ruleReports passed 2021-09-14 14:58:10 +03:00
Daniel-GrunbergerCA
aaeb663d15 remove env vars 2021-09-14 14:02:15 +03:00
Daniel-GrunbergerCA
c337005985 update build.yaml 2021-09-14 13:55:53 +03:00
Daniel-GrunbergerCA
192eeee348 update build.yaml for testing 2021-09-14 13:47:34 +03:00
yiscah
27c97684b9 delete redundant rule responses 2021-09-14 13:38:53 +03:00
Daniel-GrunbergerCA
41d5fa70ed Merge remote-tracking branch 'upstream/dev' 2021-09-14 13:21:25 +03:00
Bezalel Brandwine
4206e9c175 add caution for URLs changes 2021-09-14 12:52:35 +03:00
Daniel-GrunbergerCA
8658bb05dd change token to invitation in configmap 2021-09-14 12:23:28 +03:00
Daniel-GrunbergerCA
9b707016a9 Add set/get key-value option 2021-09-14 11:50:53 +03:00
Bezalel Brandwine
4b02826883 invitation token as param in configmap 2021-09-14 10:36:51 +03:00
Bezalel Brandwine
b29774ea71 some outputs refining 2021-09-14 09:58:17 +03:00
Benyamin Hirschberg
bf68e90a8e Merge pull request #8 from armosec/dev
Dev
2021-09-13 17:07:58 +03:00
Benyamin Hirschberg
cc5cdcd831 Merge branch 'dev' into dev 2021-09-13 17:07:51 +03:00
lalafi@cyberarmor.io
07f23ff7d9 Merge branch 'dev' of ssh://github.com/armosec/kubescape into dev 2021-09-13 16:33:32 +03:00
lalafi@cyberarmor.io
2985da6dc9 remove redundant field 2021-09-13 16:33:25 +03:00
Bezalel Brandwine
1523973749 change consts to var so ldflag -s will work 2021-09-13 15:26:29 +03:00
Bezalel Brandwine
ccafd78a14 change URLs to production at build time 2021-09-13 15:10:43 +03:00
Bezalel Brandwine
4f71fe0d55 support rerun on the same cluster flows 2021-09-13 14:25:09 +03:00
David Wertenteil
7bd6b6b4d1 Merge pull request #75 from dwertent/master
Handle download framework error
2021-09-13 11:31:25 +03:00
dwertent
2b976489a2 handle download framework error 2021-09-13 11:21:57 +03:00
dwertent
1440f20f95 merged from master 2021-09-13 11:01:49 +03:00
dwertent
941e7e27c0 Merge branch 'master' into dev 2021-09-13 11:00:30 +03:00
dwertent
5428c6ab2f merged from dev 2021-09-13 10:57:34 +03:00
David Wertenteil
851bb65d17 Merge pull request #74 from dwertent/master
* Update exception support
* Update installation script
2021-09-13 10:53:10 +03:00
dwertent
a3ce04b7e8 update install script 2021-09-13 10:47:29 +03:00
dwertent
4d68ca6aa2 update exceptions support 2021-09-13 10:24:24 +03:00
Ben Hirschberg
29c6767d3c add run locally to readme 2021-09-13 09:41:16 +03:00
Benyamin Hirschberg
d8f5f7975c Merge pull request #73 from BenHirschbergCa/dev
Inverting posture score
2021-09-13 08:34:22 +03:00
Ben Hirschberg
4cd8476837 Inverting posture score 2021-09-13 08:31:13 +03:00
Benyamin Hirschberg
112257449f Merge pull request #72 from BenHirschbergCa/dev
fixing API path
2021-09-13 08:23:22 +03:00
Ben Hirschberg
ff9cf4adf0 fixing API path 2021-09-13 08:22:25 +03:00
Benyamin Hirschberg
f2d387bc9c Merge pull request #71 from Daniel-GrunbergerCA/master
Support score, cluster name and results flag
2021-09-12 20:53:49 +03:00
lalafi@cyberarmor.io
2ceb5150e2 adding control id 2021-09-12 19:28:11 +03:00
Daniel-GrunbergerCA
00006ec721 rm omit empty 2021-09-12 18:49:13 +03:00
Daniel-GrunbergerCA
00aa6948ab Merge remote-tracking branch 'upstream/dev' 2021-09-12 18:47:31 +03:00
lalafi@cyberarmor.io
aad32ec965 added controlID 2021-09-12 18:43:45 +03:00
Daniel-GrunbergerCA
bd24ed3af7 add framework score 2021-09-12 18:37:50 +03:00
Daniel-GrunbergerCA
9fc455bcec Update posture report flag and cluster name 2021-09-12 18:13:24 +03:00
dwertent
0f8ba1e7e8 Merge branches 'master' and 'master' of github.com:armosec/kubescape 2021-09-12 17:45:32 +03:00
David Wertenteil
d3137af3d7 skip score updating 2021-09-12 17:36:23 +03:00
dwertent
775dd037d6 Merge branch 'dev' 2021-09-12 17:34:27 +03:00
dwertent
49cbfe130c do not calculate score 2021-09-12 17:34:00 +03:00
David Wertenteil
9cd61dd996 Merge pull request #70 from Moshe-Rappaport-CA/master
Support control IDs
2021-09-12 17:30:27 +03:00
moshep
292c4aa060 support id 2021-09-12 16:13:33 +03:00
moshep
56a265930d Merge remote-tracking branch 'upstream/dev' 2021-09-12 14:21:19 +03:00
Daniel-GrunbergerCA
4171d110a4 separa interfaces 2021-09-12 11:06:43 +03:00
Benyamin Hirschberg
2568241ef8 Merge pull request #69 from pettersolberg88/master
fix: Fixed Docker build not working
2021-09-12 10:19:18 +03:00
Daniel-GrunbergerCA
d0775565e9 Merge remote-tracking branch 'upstream/dev' 2021-09-12 09:40:17 +03:00
Petter Solberg
3c6b2db919 fix: Fixed Docker build not working
Building the docker image does currently not work because go.mod does not exist.
By running: `docker build -t kubescape -f build/Dockerfile .`
It fails:
```
Step 7/10 : RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w " -installsuffix cgo  -o kubescape .
 ---> Running in 3e7d4a124446
cautils/k8sinterface/cloudvendorregistrycreds.go:14:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws (imported by github.com/armosec/kubescape/cautils/k8sinterface); to add:
        go get github.com/armosec/kubescape/cautils/k8sinterface
cautils/k8sinterface/cloudvendorregistrycreds.go:15:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws/session (imported by github.com/armosec/kubescape/cautils/k8sinterface); to add:
        go get github.com/armosec/kubescape/cautils/k8sinterface
...
```
By changing mod download to go mod tidy, it creates go.sum and the docker build works.
2021-09-10 14:10:09 +02:00
David Wertenteil
ca4d4a096c Support self registration 2021-09-10 01:20:28 +03:00
dwertent
ff27db6b83 Merge remote-tracking branch 'upstream/dev' 2021-09-10 00:58:24 +03:00
Daniel Grunberger
c9ecb6c563 Add version handling (#67)
* start version handling

* add version handling

* update latest version check

* update build.yaml

* erase unused vars

* fix build.yaml

* fix var name

* handle error
2021-09-10 00:57:33 +03:00
dwertent
b9e5782264 support self registeration 2021-09-10 00:56:51 +03:00
Daniel-GrunbergerCA
d852f81cb0 handle error 2021-09-09 19:56:29 +03:00
dwertent
6137aa5d8e support fronegg 2021-09-09 17:15:55 +03:00
Daniel-GrunbergerCA
131b67ee83 fix var name 2021-09-09 16:26:42 +03:00
Daniel-GrunbergerCA
db6f00be08 fix build.yaml 2021-09-09 15:23:34 +03:00
Daniel-GrunbergerCA
2ecc80985a Merge remote-tracking branch 'upstream/dev' 2021-09-09 15:18:56 +03:00
Daniel-GrunbergerCA
93dbfd5110 erase unused vars 2021-09-09 15:15:36 +03:00
Daniel-GrunbergerCA
ae0c384c85 update build.yaml 2021-09-09 15:02:48 +03:00
Benyamin Hirschberg
f60ff1fb26 Merge pull request #63 from zc2638/feat/dockerfile
add docker build
2021-09-09 14:59:46 +03:00
Daniel-GrunbergerCA
08a81696a1 update latest version check 2021-09-09 14:58:52 +03:00
Daniel-GrunbergerCA
8375a8ae63 add version handling 2021-09-09 14:37:25 +03:00
Daniel-GrunbergerCA
31d8cf5118 start version handling 2021-09-09 12:29:42 +03:00
dwertent
597b967e55 Merge remote-tracking branch 'upstream/dev' 2021-09-09 11:43:44 +03:00
dwertent
679238ec13 download from release 2021-09-09 09:53:08 +03:00
dwertent
94884ac3d7 Merge branch 'master' into dev 2021-09-09 09:50:45 +03:00
Benyamin Hirschberg
0ef8f20c50 Merge pull request #65 from BenHirschbergCa/master
Cleanup in build file
2021-09-08 21:30:22 +03:00
Ben Hirschberg
82f3d62de5 clean up build file 2021-09-08 21:29:21 +03:00
Benyamin Hirschberg
46f1e6a83b Merge pull request #7 from armosec/master
rebase
2021-09-08 21:27:16 +03:00
Benyamin Hirschberg
65841a014f Merge branch 'master' into master 2021-09-08 21:27:02 +03:00
Benyamin Hirschberg
985c6868c1 Fixing URL typo 2021-09-08 21:21:25 +03:00
Shauli Rozen
fca862b2c7 Update README.md 2021-09-07 21:10:27 +03:00
zc
77a9956d91 add docker build 2021-09-07 14:21:39 +08:00
David Wertenteil
3a4a58fdd5 remove deffer func (#60) 2021-09-05 17:36:41 +03:00
dwertent
a1e639453d remove deffer func 2021-09-05 17:35:56 +03:00
dwertent
7da23c111e adding exceptions after merge 2021-09-05 17:29:53 +03:00
dwertent
768556251d support exceptions
use rego store
2021-09-05 17:22:47 +03:00
dwertent
00fcc565b5 ignore md5sum 2021-09-05 17:14:00 +03:00
Ben Hirschberg
9c74e5c93b Merge branch 'master' of github.com:BenHirschbergCa/kubescape 2021-09-05 17:00:37 +03:00
Ben Hirschberg
6a0ee6e0d7 specific upload files 2021-09-05 16:59:55 +03:00
Benyamin Hirschberg
93bb09d78e Merge pull request #6 from BenHirschbergCa/dev
removing unneeded fields
2021-09-05 16:51:40 +03:00
Ben Hirschberg
228e7703a8 removing unneeded fields 2021-09-05 16:51:00 +03:00
Benyamin Hirschberg
4b15a3b8e0 Merge pull request #5 from BenHirschbergCa/dev
moving to alexellis/upload-assets
2021-09-05 16:47:11 +03:00
Ben Hirschberg
80c5fd7439 moving to alexellis/upload-assets 2021-09-05 16:46:13 +03:00
Benyamin Hirschberg
504c4acc42 Merge pull request #4 from BenHirschbergCa/dev
returning master push run
2021-09-05 15:38:09 +03:00
Ben Hirschberg
573d85d770 returning master push run 2021-09-05 15:37:18 +03:00
Benyamin Hirschberg
4247f66378 Merge pull request #3 from BenHirschbergCa/dev
fixing upload file list
2021-09-05 15:34:37 +03:00
Benyamin Hirschberg
7d6a10e787 Merge pull request #59 from BenHirschbergCa/dev
Dev
2021-09-05 15:29:19 +03:00
Ben Hirschberg
bad303692e fixing upload file list 2021-09-05 15:28:33 +03:00
Benyamin Hirschberg
af3b33f7b0 Merge pull request #2 from BenHirschbergCa/dev
Dev
2021-09-05 15:23:12 +03:00
Ben Hirschberg
fd66b2eba5 build on pull requests only! 2021-09-05 15:22:02 +03:00
Ben Hirschberg
157ba1a08d ws 2021-09-05 15:20:13 +03:00
Benyamin Hirschberg
6b15e6575b Merge pull request #1 from BenHirschbergCa/dev
Dev
2021-09-05 15:18:48 +03:00
Ben Hirschberg
53f3229e9f adding m5sum 2021-09-05 15:17:55 +03:00
Ben Hirschberg
186435de69 test pinging 2021-09-05 15:03:39 +03:00
David Wertenteil
4d027d691f Support exceptions (#58)
* support exceptions

* update screenshot

* update summary
2021-09-05 14:44:55 +03:00
dwertent
3f84ee3fcc update summary 2021-09-05 14:42:49 +03:00
dwertent
38103ac90b update screenshot 2021-09-05 14:39:13 +03:00
dwertent
13d27697e1 update readme 2021-09-05 14:33:32 +03:00
dwertent
942f356d19 support exceptions 2021-09-05 14:21:51 +03:00
dwertent
b87b687e2f support exceptions 2021-09-02 17:41:03 +03:00
dwertent
2e313719bb adding scaore and excpetion to code 2021-09-02 14:54:04 +03:00
dwertent
0c5eb48fdb Merge remote-tracking branch 'upstream/master' 2021-09-02 13:21:13 +03:00
dwertent
2ae2c81e0b rm download 2021-09-02 13:18:23 +03:00
Benyamin Hirschberg
23090fbb9f Merge pull request #53 from armosec/dev
Supporting failure threshold
2021-09-02 00:00:17 +03:00
Benyamin Hirschberg
fcb6255f75 Merge pull request #52 from BenHirschbergCa/dev
Support failure threshold
2021-09-01 23:59:16 +03:00
Ben Hirschberg
abbc9c3e2e Support failure threshold 2021-09-01 23:41:12 +03:00
David Wertenteil
75f76fcecd Update README.md 2021-09-01 17:23:52 +03:00
dwertent
a00bba5fe4 support downloaded files 2021-09-01 17:18:26 +03:00
Daniel Grunberger
96473188ed Merge pull request #51 from Daniel-GrunbergerCA/master
scan with local file
2021-09-01 17:11:55 +03:00
Daniel-GrunbergerCA
56264df047 update scan with local file 2021-09-01 17:02:41 +03:00
Daniel-GrunbergerCA
c3008981e4 download from be 2021-09-01 16:51:43 +03:00
Daniel Grunberger
572130d797 Merge pull request #49 from Daniel-GrunbergerCA/master
support store download
2021-09-01 16:35:39 +03:00
Daniel-GrunbergerCA
7d8cf37532 support store download 2021-09-01 16:32:33 +03:00
Daniel-GrunbergerCA
ebd9661255 Merge remote-tracking branch 'upstream/dev' 2021-09-01 15:51:35 +03:00
Daniel-GrunbergerCA
05e108b47b add download json option 2021-09-01 15:51:24 +03:00
dwertent
8cb6824f3c ignore k8s config when running local yamls 2021-09-01 13:29:44 +03:00
dwertent
304017fc41 Merge branch 'dev' of ssh://github.com/armosec/kubescape into dev 2021-09-01 11:04:49 +03:00
dwertent
b82673f694 Merge branch 'master' of ssh://github.com/armosec/kubescape 2021-09-01 11:03:27 +03:00
dwertent
ac7e5219f1 interface support of framework 2021-09-01 11:03:20 +03:00
Daniel Grunberger
a4c4f9c6ed Update README.md 2021-08-31 17:22:27 +03:00
dwertent
222b154505 store file localy 2021-08-31 17:08:02 +03:00
dwertent
67c2de74f1 adding download script 2021-08-31 17:05:16 +03:00
dwertent
4a9b36807a remove sudo 2021-08-31 16:43:37 +03:00
dwertent
c6241fab38 remove sudo 2021-08-31 16:42:12 +03:00
dwertent
afbc69c6d2 Merge remote-tracking branch 'upstream/dev' 2021-08-31 16:41:44 +03:00
David Wertenteil
571a15bee8 Update README.md 2021-08-31 16:31:06 +03:00
dwertent
8a00a5c54b Add input table to readme 2021-08-31 16:29:11 +03:00
Daniel Grunberger
8f8aaf70d9 Update README.md 2021-08-31 13:00:17 +03:00
David Wertenteil
d3f4af0f9c Update module to github (#47)
* update module
2021-08-31 12:00:42 +03:00
dwertent
2779cb4e25 update module 2021-08-31 11:47:44 +03:00
dwertent
f46ee93539 update modul name 2021-08-31 11:39:27 +03:00
dwertent
3eb087e5c1 Merge remote-tracking branch 'upstream/dev' 2021-08-31 11:38:14 +03:00
dwertent
f069955231 Merge branch 'master' of ssh://github.com/armosec/kubescape 2021-08-31 11:07:16 +03:00
dwertent
d5290a6671 support new controls 2021-08-31 11:05:59 +03:00
dwertent
a54dac51af remove beta from version 2021-08-31 10:42:05 +03:00
Daniel Grunberger
823455846f Update README.md 2021-08-31 10:38:32 +03:00
Daniel Grunberger
39c7bfeed9 Merge pull request #46 from Daniel-GrunbergerCA/master
Add anonymous http req
2021-08-31 10:27:11 +03:00
danielgrunbergerarmo
67fc9832f8 Merge remote-tracking branch 'upstream/dev' 2021-08-31 10:14:41 +03:00
danielgrunbergerarmo
559c4f3f15 add anonymous http req 2021-08-31 09:55:23 +03:00
dwertent
187f517f58 update help print 2021-08-31 09:27:29 +03:00
dwertent
c963b19364 Merge branch 'master' of ssh://github.com/armosec/kubescape into dev 2021-08-31 09:14:59 +03:00
David Wertenteil
2d7c5fd1ce update output functionality (#45)
* update output f
2021-08-31 09:13:12 +03:00
dwertent
59c935e723 update output f 2021-08-31 09:00:52 +03:00
dwertent
bae45d277f Merge remote-tracking branch 'upstream/dev' 2021-08-31 08:47:37 +03:00
Benyamin Hirschberg
e728b3ae37 Merge pull request #44 from BenHirschbergCa/dev
some fixes around command texts
2021-08-30 22:08:36 +03:00
Benyamin Hirschberg
01bc5345ab Merge branch 'dev' into dev 2021-08-30 22:08:13 +03:00
Ben Hirschberg
fc2374a690 some fixes around command textx 2021-08-30 22:03:03 +03:00
David Wertenteil
00314be32a Update format and output flags (#43)
* support stdin input

* support output to file
2021-08-30 18:49:17 +03:00
dwertent
0b6dfa9cd0 Merge remote-tracking branch 'upstream/dev' 2021-08-30 18:47:07 +03:00
dwertent
1ff3a6c92c support output to file 2021-08-30 18:44:42 +03:00
David Wertenteil
c8068a8d90 Support stdin input (#42)
* support stdin input
2021-08-30 14:55:50 +03:00
dwertent
f75cee0d78 support stdin input 2021-08-30 14:54:01 +03:00
dwertent
229f16cb01 Merge remote-tracking branch 'upstream/dev' 2021-08-30 13:52:58 +03:00
David Wertenteil
44803ab915 Support glob file loading (#41)
* recursive glob

* adding helm support to readme

* update glob function
2021-08-30 11:06:13 +03:00
dwertent
2c6b1a440f update glob function 2021-08-30 08:53:34 +03:00
dwertent
37afc1352f adding helm support to readme 2021-08-29 13:34:40 +03:00
dwertent
9943119033 recursive glob 2021-08-29 13:15:34 +03:00
dwertent
41457ff551 Merge remote-tracking branch 'upstream/dev' 2021-08-29 10:38:42 +03:00
dwertent
82b64b5828 Merge remote-tracking branch 'origin/dev' 2021-08-29 10:35:59 +03:00
dwertent
229e8acc74 Merge remote-tracking branch 'origin/yamlsupport' 2021-08-29 10:35:32 +03:00
David Wertenteil
b50a665920 Update README.md 2021-08-29 10:21:32 +03:00
David Wertenteil
2d5ed19d6d support url input and update readme (#40)
* split to functions

* update package name to kubescape

* support url input, update readme
2021-08-29 10:20:12 +03:00
David Wertenteil
30324e1c01 Merge branch 'dev' into yamlsupport 2021-08-29 10:19:09 +03:00
dwertent
8ca356eae7 Merge remote-tracking branch 'upstream/master' 2021-08-29 10:09:54 +03:00
dwertent
29f4ae368d support url input, update readme 2021-08-29 10:08:49 +03:00
dwertent
409080f51b update package name o kubescape 2021-08-29 08:17:09 +03:00
Benyamin Hirschberg
81e5bc3991 Merge pull request #39 from BenHirschbergCa/dev
Adding explanation about YAML support and output integration
2021-08-28 22:22:05 +03:00
Ben Hirschberg
d6a9e50626 Adding exaplanation about YAML support and output integration 2021-08-28 22:19:18 +03:00
David Wertenteil
7500438991 Support yaml input and silent mode print
Support yaml input and silent mode print
2021-08-26 18:37:42 +03:00
dwertent
0b24c46279 Merge remote-tracking branch 'upstream/dev' 2021-08-26 18:30:50 +03:00
dwertent
49596c5ac1 split to function 2021-08-26 18:29:32 +03:00
dwertent
328265559c after merge 2021-08-26 18:13:46 +03:00
dwertent
1fae5755fe example sh 2021-08-26 17:42:02 +03:00
dwertent
96148ac6fd support yaml input 2021-08-26 17:41:11 +03:00
danielgrunbergerarmo
b2fcf295ce add silent flag 2021-08-26 13:50:48 +03:00
Daniel Grunberger
89ad5c1df0 Merge pull request #30 from Daniel-GrunbergerCA/master
Support json and junit output
2021-08-26 13:48:16 +03:00
Benyamin Hirschberg
798994850d Adding link to download badge 2021-08-26 13:11:07 +03:00
dwertent
9bf79db8f8 Merge branch 'Daniel-GrunbergerCA-master' into dev 2021-08-26 12:22:34 +03:00
dwertent
f9ab72d595 after merge 2021-08-26 12:15:58 +03:00
dwertent
8f4ac5dd87 adding yaml input 2021-08-26 12:11:04 +03:00
danielgrunbergerarmo
5a5f2b408c support json and junit output 2021-08-26 11:30:51 +03:00
danielgrunbergerarmo
615c1af63e Merge remote-tracking branch 'upstream/dev' 2021-08-26 11:17:37 +03:00
danielgrunbergerarmo
c67e584cfb Support yamls 2021-08-26 11:03:51 +03:00
dwertent
6414be3c6f Merge remote-tracking branch 'upstream/dev' 2021-08-26 10:37:21 +03:00
Benyamin Hirschberg
3d9f98e866 Merge pull request #28 from BenHirschbergCa/dev
added JUnit formatter
2021-08-26 07:44:26 +03:00
Ben Hirschberg
aba67cc596 asigning class name 2021-08-26 07:42:57 +03:00
Ben Hirschberg
0d43fec008 Junit XML support 2021-08-25 22:32:10 +03:00
Benyamin Hirschberg
2574f1954d Merge pull request #26 from BenHirschbergCa/dev
Adding JSON print option and fixing typos
2021-08-25 17:47:12 +03:00
Ben Hirschberg
b97f7d6e36 adding option for JSON output 2021-08-25 17:37:49 +03:00
Ben Hirschberg
ce908aa748 fixing typo 2021-08-25 17:09:04 +03:00
Daniel Grunberger
707a2c78fe Merge pull request #25 from amiralis/patch-1
Fix typo
2021-08-25 16:36:05 +03:00
Ben Hirschberg
5f1bb0ce0a State supported Go version 2021-08-25 11:35:24 +03:00
Amirali Sanatinia
4683b56ce0 Fix typo
"Kubernetes Hardening Guidance by to NSA and CISA" -> "Kubernetes Hardening Guidance by NSA and CISA"
2021-08-24 15:46:03 -04:00
danielgrunbergerarmo
a7e69c8096 start using cobra pkg for cli flags 2021-08-24 17:35:57 +03:00
Daniel Grunberger
3735f4fcc2 Merge pull request #23 from Daniel-GrunbergerCA/master
Download framework from staging
2021-08-24 10:30:04 +03:00
danielgrunbergerarmo
2606be8ecd Merge remote-tracking branch 'upstream/master' 2021-08-24 10:25:36 +03:00
danielgrunbergerarmo
c51ea6bafd Download framework from staging 2021-08-24 10:25:15 +03:00
dwertent
6588507e6f Support kubeconfig from KUBECONFIG env and --kubeconfig flag. issue #15 2021-08-24 09:33:59 +03:00
dwertent
b9da2380fa Support kubeconfig from KUBECONFIG env and --kubeconfig flag. issue #15 2021-08-24 09:04:09 +03:00
Mayo
e162d5e8b2 feat: support kubeconfig env 2021-08-24 12:05:30 +08:00
Bezbran
5bec5b0075 fix release semvar 2021-08-23 17:35:48 +03:00
Bezbran
747940d66c add some whitespaces 2021-08-23 17:33:43 +03:00
Benyamin Hirschberg
789902f534 Update README.md 2021-08-23 13:30:24 +03:00
Benyamin Hirschberg
140ef8ac91 Update README.md 2021-08-23 13:27:06 +03:00
Daniel Grunberger
4b4b05caba Update README.md 2021-08-22 21:12:38 +03:00
David Wertenteil
abbb14c571 Support os
Support os
2021-08-22 12:08:29 +03:00
dwertent
93a5f133c3 support os types 2021-08-22 12:03:28 +03:00
dwertent
50f99f4719 run once 2021-08-22 08:46:06 +03:00
dwertent
ba45dd9f1c rm from path 2021-08-22 08:26:06 +03:00
dwertent
7669f791d5 remove path from setup 2021-08-22 08:23:48 +03:00
dwertent
c592728f62 add os to path 2021-08-22 08:20:56 +03:00
dwertent
ea0d48bf6d update tag name 2021-08-22 08:09:55 +03:00
dwertent
b8a9dd9359 update tag name 2021-08-22 08:03:54 +03:00
dwertent
dba4520f27 adding os name 2021-08-22 07:55:24 +03:00
dwertent
111d04dabe remove os from name 2021-08-21 23:15:45 +03:00
dwertent
5f5215ff8e update install 2021-08-21 23:13:27 +03:00
dwertent
12a6229193 support os release 2021-08-21 23:10:48 +03:00
dwertent
0992e6edd7 sort summary table 2021-08-20 00:07:29 +03:00
dwertent
12294ad23c download latest release 2021-08-19 23:23:07 +03:00
David Wertenteil
b2d14a778a Sort controls, update gif
Sort control output
2021-08-19 22:45:01 +03:00
dwertent
b92a44dd7c sort control output 2021-08-19 22:41:35 +03:00
Daniel Grunberger
35ea718080 Add new tests 2021-08-19 17:50:06 +03:00
Daniel Grunberger
47ed057e66 Update tag 2021-08-19 17:45:59 +03:00
David Wertenteil
5e0e5c6231 do not run flow on push 2021-08-19 17:43:48 +03:00
David Wertenteil
4f9a4a6c61 update release 2021-08-19 17:37:22 +03:00
David Wertenteil
22b3544243 Update error handling 2021-08-19 17:36:21 +03:00
danielgrunbergerarmo
297a4fc42b fix error handling 2021-08-19 13:42:23 +03:00
Daniel Grunberger
405cd837a1 Update README.md 2021-08-18 18:45:46 +03:00
dwertent
e6b2688462 update install version 2021-08-18 14:56:48 +03:00
Daniel Grunberger
e5b35fcb55 Merge pull request #6 from Daniel-GrunbergerCA/master
Update output format
2021-08-18 14:54:59 +03:00
Daniel Grunberger
35449e3d4e Merge branch 'master' into master 2021-08-18 14:54:33 +03:00
danielgrunbergerarmo
9509c69d87 update install version 2021-08-18 14:51:05 +03:00
danielgrunbergerarmo
34170faae9 update readme.md 2021-08-18 14:45:49 +03:00
danielgrunbergerarmo
d5d0da8ac3 fix non-namespacd resources 2021-08-18 14:33:14 +03:00
danielgrunbergerarmo
8b7a4b1e48 fix output format 2021-08-18 14:21:44 +03:00
danielgrunbergerarmo
d5383fe218 fix field selector for non-namespaced resources 2021-08-18 14:04:00 +03:00
dwertent
46b9cf35ac update version 2021-08-18 12:05:01 +03:00
danielgrunbergerarmo
329d341fbf delete build.yaml 2021-08-18 11:58:23 +03:00
David Wertenteil
6be692c66f Merge pull request #4 from Daniel-GrunbergerCA/master
add exclude-namespaces flag
2021-08-18 11:56:43 +03:00
danielgrunbergerarmo
3c062238ad add cli flag 2021-08-18 11:48:10 +03:00
Daniel Grunberger
954224e9f6 Update README.md 2021-08-17 17:39:50 +03:00
David Wertenteil
a5f99e0a8d Merge pull request #3 from dwertent/master
Update description display
2021-08-17 16:27:53 +03:00
dwertent
d484aeb62c update description 2021-08-17 16:24:23 +03:00
Daniel Grunberger
8c3eeab7ed Update README.md 2021-08-17 13:37:24 +03:00
Benyamin Hirschberg
cea8266734 Update README.md 2021-08-15 22:35:29 +03:00
Benyamin Hirschberg
eefaf7b23c adding progress bar 2021-08-15 21:53:26 +03:00
633 changed files with 285492 additions and 8770 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Keep CRLF newlines in appropriate test files to have reproducible tests
core/pkg/fixhandler/testdata/inserts/*-crlf-newlines.yaml text eol=crlf

33
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''
---
# Description
<!-- A clear and concise description of what the bug is. -->
# Environment
OS: ` ` <!-- the OS + version youre running Kubescape on, e.g Ubuntu 22.04 LTS -->
Version: ` ` <!-- the version that Kubescape reports when you run `kubescape version` -->
# Steps To Reproduce
<!--
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
# Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
# Actual Behavior
<!-- A clear and concise description of what happened. If applicable, add screenshots to help explain your problem. -->
# Additional context
<!-- Add any other context about the problem here. -->

View File

@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'feature'
assignees: ''
---
## Overview
<!-- A brief overview of the related current state -->
## Problem
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
## Solution
<!-- A clear and concise description of what you want to happen. -->
## Alternatives
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
## Additional context
<!-- Add any other context or screenshots about the feature request here. -->

44
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,44 @@
## Overview
<!-- Please provide a brief overview of the changes made in this pull request. e.g. current behavior/future behavior -->
<!--
## Additional Information
> Any additional information that may be useful for reviewers to know
-->
<!--
## How to Test
> Please provide instructions on how to test the changes made in this pull request
-->
<!--
## Examples/Screenshots
> Here you add related screenshots
-->
<!--
## Related issues/PRs:
Here you add related issues and PRs.
If this resolved an issue, write "Resolved #<issue number>
e.g. If this PR resolves issues 1 and 2, it should look as follows:
* Resolved #1
* Resolved #2
-->
<!--
## Checklist before requesting a review
put an [x] in the box to get it checked
- [ ] My code follows the style guidelines of this project
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have performed a self-review of my code
- [ ] If it is a core feature, I have added thorough tests.
- [ ] New and existing unit tests pass locally with my changes
-->

44
.github/actions/tag-action/action.yaml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: 'Tag validator and retag'
description: 'This action will check if the tag is rc and create a new tag for release'
inputs:
ORIGINAL_TAG: # id of input
description: 'Original tag'
required: true
default: ${{ github.ref_name }}
SUB_STRING:
description: 'Sub string for rc tag'
required: true
default: "-rc"
outputs:
NEW_TAG:
description: "The new tag for release"
value: ${{ steps.retag.outputs.NEW_TAG }}
runs:
using: "composite"
steps:
- run: |
if [[ -z "${{ inputs.ORIGINAL_TAG }}" ]]; then
echo "The value of ORIGINAL_TAG is ${{ inputs.ORIGINAL_TAG }}"
echo "Setting the value of ORIGINAL_TAG to ${{ github.ref_name }}"
echo ORIGINAL_TAG="${{ github.ref_name }}" >> $GITHUB_ENV
fi
shell: bash
- run: |
if [[ "${{ inputs.ORIGINAL_TAG }}" == *"${{ inputs.SUB_STRING }}"* ]]; then
echo "Release candidate tag found."
else
echo "Release candidate tag not found."
exit 1
fi
shell: bash
- id: retag
run: |
NEW_TAG=
echo "Original tag: ${{ inputs.ORIGINAL_TAG }}"
NEW_TAG=$(echo ${{ inputs.ORIGINAL_TAG }} | awk -F '-rc' '{print $1}')
echo "New tag: $NEW_TAG"
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_OUTPUT
shell: bash

11
.github/dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

243
.github/workflows/00-pr-scanner.yaml vendored Normal file
View File

@@ -0,0 +1,243 @@
name: 00-pr_scanner
permissions: read-all
on:
workflow_dispatch: {}
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore:
- "**.yaml"
- "**.yml"
- "**.md"
- "**.sh"
- "website/*"
- "examples/*"
- "docs/*"
- "build/*"
- ".github/*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pr-scanner:
permissions:
actions: read
artifact-metadata: read
attestations: read
checks: read
contents: write
deployments: read
discussions: read
id-token: write
issues: read
models: read
packages: read
pages: read
pull-requests: write
repository-projects: read
security-events: read
statuses: read
uses: ./.github/workflows/a-pr-scanner.yaml
with:
RELEASE: ""
CLIENT: test
CGO_ENABLED: 0
GO111MODULE: ""
secrets: inherit
wf-preparation:
name: secret-validator
runs-on: ubuntu-latest
outputs:
is-secret-set: ${{ steps.check-secret-set.outputs.is-secret-set }}
steps:
- name: check if the necessary secrets are set in github secrets
id: check-secret-set
env:
CUSTOMER: ${{ secrets.CUSTOMER }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
CLIENT_ID: ${{ secrets.CLIENT_ID_PROD }}
SECRET_KEY: ${{ secrets.SECRET_KEY_PROD }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: "echo \"is-secret-set=${{ env.CUSTOMER != '' && env.USERNAME != '' && env.PASSWORD != '' && env.CLIENT_ID != '' && env.SECRET_KEY != '' && env.REGISTRY_USERNAME != '' && env.REGISTRY_PASSWORD != '' }}\" >> $GITHUB_OUTPUT\n"
run-system-tests:
needs: [wf-preparation, pr-scanner]
if: ${{ (needs.wf-preparation.outputs.is-secret-set == 'true') && (always() && (contains(needs.*.result, 'success') || contains(needs.*.result, 'skipped')) && !(contains(needs.*.result, 'failure')) && !(contains(needs.*.result, 'cancelled'))) }}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
pull-requests: write
steps:
- name: Set dispatch info
id: dispatch-info
run: |
# Correlation ID WITHOUT attempt - so re-runs can find the original run
CORRELATION_ID="${GITHUB_REPOSITORY##*/}-${{ github.run_id }}"
echo "correlation_id=${CORRELATION_ID}" >> "$GITHUB_OUTPUT"
echo "Correlation ID: ${CORRELATION_ID}, Attempt: ${{ github.run_attempt }}"
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.E2E_DISPATCH_APP_ID }}
private-key: ${{ secrets.E2E_DISPATCH_APP_PRIVATE_KEY }}
owner: armosec
repositories: shared-workflows
- name: Dispatch system tests to private repo
if: ${{ github.run_attempt == 1 }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
CORRELATION_ID: ${{ steps.dispatch-info.outputs.correlation_id }}
KS_BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
echo "Dispatching E2E tests with correlation_id: ${CORRELATION_ID}"
echo "Using test group: KUBESCAPE_CLI_E2E"
gh api "repos/armosec/shared-workflows/dispatches" \
-f event_type="e2e-test-trigger" \
-f "client_payload[correlation_id]=${CORRELATION_ID}" \
-f "client_payload[github_repository]=${GITHUB_REPOSITORY}" \
-f "client_payload[environment]=production" \
-f "client_payload[tests_groups]=KUBESCAPE_CLI_E2E" \
-f "client_payload[systests_branch]=master" \
-f "client_payload[ks_branch]=${KS_BRANCH}"
echo "Dispatch completed"
- name: Find E2E workflow run
id: find-run
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
CORRELATION_ID: ${{ steps.dispatch-info.outputs.correlation_id }}
run: |
for i in {1..15}; do
run_id=$(gh api "repos/armosec/shared-workflows/actions/runs?event=repository_dispatch&per_page=30" \
--jq '.workflow_runs | map(select(.name | contains("'"$CORRELATION_ID"'"))) | first | .id // empty')
if [ -n "$run_id" ]; then
echo "run_id=${run_id}" >> "$GITHUB_OUTPUT"
gh api "repos/armosec/shared-workflows/actions/runs/${run_id}" --jq '"url=" + .html_url' >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Attempt $i: waiting for run..."
sleep $((i < 5 ? 10 : 30))
done
echo "::error::Could not find workflow run"
exit 1
- name: Re-run failed jobs in private repo
id: rerun
if: ${{ github.run_attempt > 1 }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RUN_ID: ${{ steps.find-run.outputs.run_id }}
run: |
conclusion=$(gh api "repos/armosec/shared-workflows/actions/runs/${RUN_ID}" --jq '.conclusion')
echo "Previous conclusion: $conclusion"
if [ "$conclusion" = "success" ]; then
echo "Previous run passed. Nothing to re-run."
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# Full rerun if cancelled, partial if failed
if [ "$conclusion" = "cancelled" ]; then
echo "Run was cancelled - triggering full re-run"
gh api --method POST "repos/armosec/shared-workflows/actions/runs/${RUN_ID}/rerun"
else
echo "Re-running failed jobs only"
gh api --method POST "repos/armosec/shared-workflows/actions/runs/${RUN_ID}/rerun-failed-jobs"
fi
# Wait for status to flip from 'completed'
for i in {1..30}; do
[ "$(gh api "repos/armosec/shared-workflows/actions/runs/${RUN_ID}" --jq '.status')" != "completed" ] && break
sleep 2
done
- name: Wait for E2E tests to complete
if: ${{ steps.rerun.outputs.skip != 'true' }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RUN_ID: ${{ steps.find-run.outputs.run_id }}
URL: ${{ steps.find-run.outputs.url }}
run: |
echo "Monitoring: ${URL}"
for i in {1..60}; do # 60 iterations × 60s = 1 hour max
read status conclusion < <(gh api "repos/armosec/shared-workflows/actions/runs/${RUN_ID}" \
--jq '[.status, .conclusion // "null"] | @tsv')
echo "Status: ${status} | Conclusion: ${conclusion}"
if [ "$status" = "completed" ]; then
if [ "$conclusion" = "success" ]; then
echo "E2E tests passed!"
exit 0
fi
echo "::error::E2E tests failed: ${conclusion}"
echo ""
# Get failed job IDs to a file first
gh api "repos/armosec/shared-workflows/actions/runs/${RUN_ID}/jobs" \
--jq '.jobs[] | select(.conclusion == "failure") | [.id, .name, (.steps[] | select(.conclusion == "failure") | .name)] | @tsv' > /tmp/failed_jobs.txt
# Process each failed job
while IFS=$'\t' read -r job_id job_name step_name; do
# Extract test name: "run-helm-e2e / ST (relevancy_python)" → "relevancy_python"
test_name=$(echo "$job_name" | sed 's/.*(\(.*\))/\1/')
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "${job_name}"
echo " Step: ${step_name}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Fetch logs to temp file
gh api "repos/armosec/shared-workflows/actions/jobs/${job_id}/logs" 2>/dev/null > /tmp/job_logs.txt
# Show summary in console
grep -E "(ERROR|FAILURE)" /tmp/job_logs.txt | tail -10
echo ""
# Save to separate file per test
log_file="failed_${test_name}.txt"
echo "════════════════════════════════════════" > "$log_file"
echo "${job_name}" >> "$log_file"
echo " Step: ${step_name}" >> "$log_file"
echo "════════════════════════════════════════" >> "$log_file"
last_endgroup=$(grep -n "##\\[endgroup\\]" /tmp/job_logs.txt | tail -1 | cut -d: -f1)
if [ -n "$last_endgroup" ]; then
tail -n +$((last_endgroup + 1)) /tmp/job_logs.txt >> "$log_file"
else
tail -500 /tmp/job_logs.txt >> "$log_file"
fi
done < /tmp/failed_jobs.txt
echo "View full logs: ${URL}"
exit 1
fi
sleep 60
done
echo "::error::Timeout waiting for tests"
exit 1
- name: Upload failed step logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-e2e-logs-attempt-${{ github.run_attempt }}
path: failed_*.txt
retention-days: 7

125
.github/workflows/02-release.yaml vendored Normal file
View File

@@ -0,0 +1,125 @@
name: 02-create_release
permissions: read-all
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
skip_publish:
description: "Skip publishing artifacts"
required: false
default: true
type: boolean
jobs:
release:
permissions:
actions: read
checks: read
contents: write
deployments: read
discussions: read
id-token: write
issues: read
models: read
packages: write
pages: read
pull-requests: read
repository-projects: read
statuses: read
security-events: read
attestations: read
artifact-metadata: read
runs-on: ubuntu-large
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.25"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install system dependencies for system-tests
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libpq5 \
libpq-dev \
gcc \
python3-dev
sudo rm -rf /var/lib/apt/lists/*
- name: Install Cosign
uses: sigstore/cosign-installer@v3.5.0
- name: Create Cosign Key
run: echo "${{ secrets.COSIGN_PRIVATE_KEY_V1 }}" > cosign.key
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAYIO_REGISTRY_USERNAME }}
password: ${{ secrets.QUAYIO_REGISTRY_PASSWORD }}
- uses: anchore/sbom-action/download-syft@v0
name: Setup Syft
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.10.0
with:
cluster_name: kubescape-e2e
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean ${{ inputs.skip_publish == true && '--skip=publish' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
COSIGN_PWD: ${{ secrets.COSIGN_PRIVATE_KEY_V1_PASSWORD }}
RELEASE: ${{ github.ref_name }}
CLIENT: release
RUN_E2E: "true"
KUBESCAPE_SKIP_UPDATE_CHECK: "true"
CUSTOMER: ${{ secrets.CUSTOMER }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
CLIENT_ID: ${{ secrets.CLIENT_ID_PROD }}
SECRET_KEY: ${{ secrets.SECRET_KEY_PROD }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
- name: Update new version in krew-index
if: github.event_name != 'workflow_dispatch' || inputs.skip_publish != true
uses: rajatjindal/krew-release-bot@v0.0.47
with:
krew_template_file: .krew.yaml
- name: List collected system-test results (debug)
if: always()
run: |
echo "Listing test-results/system-tests (if any):"
ls -laR test-results/system-tests || true
- name: System Tests Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: "test-results/system-tests/**/results_xml_format/**.xml"
annotate_only: true
job_summary: true

52
.github/workflows/README.md vendored Normal file
View File

@@ -0,0 +1,52 @@
# Kubescape workflows
Tag terminology: `v<major>.<minor>.<patch>`
## Developing process
Kubescape's main branch is `main`, any PR will be opened against the main branch.
### Opening a PR
When a user opens a PR, this will trigger some basic tests (units, license, etc.)
### Reviewing a PR
The reviewer/maintainer of a PR will decide whether the PR introduces changes that require running the E2E system tests. If so, the reviewer will add the `trigger-integration-test` label.
### Approving a PR
Once a maintainer approves the PR, if the `trigger-integration-test` label was added to the PR, the GitHub actions will trigger the system test. The PR will be merged only after the system tests passed successfully. If the label was not added, the PR can be merged.
### Merging a PR
The code is merged, no other actions are needed
## Release process
Every two weeks, we will create a new tag by bumping the minor version, this will create the release and publish the artifacts.
If we are introducing breaking changes, we will update the `major` version instead.
When we wish to push a hot-fix/feature within the two weeks, we will bump the `patch`.
### Creating a new tag
Every two weeks or upon the decision of the maintainers, a maintainer can create a tag.
The tag should look as follows: `v<A>.<B>.<C>-rc.D` (release candidate).
When creating a tag, GitHub will trigger the following actions:
1. Basic tests - unit tests, license, etc.
2. System tests (integration tests). If the tests fail, the actions will stop here.
3. Create a new tag: `v<A>.<B>.<C>` (same tag just without the `rc` suffix)
4. Create a release
5. Publish artifacts
6. Build and publish the docker image (this is meanwhile until we separate the microservice code from the LCI codebase)
## Additional Information
The "callers" have the alphabetic prefix and the "executes" have the numeric prefix
## Screenshot
<img width="1469" alt="image" src="https://user-images.githubusercontent.com/64066841/212532727-e82ec9e7-263d-408b-b4b0-a8c943f0109a.png">

76
.github/workflows/a-pr-scanner.yaml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: a-pr-scanner
permissions: read-all
on:
workflow_call:
inputs:
RELEASE:
description: 'release'
required: true
type: string
CLIENT:
description: 'Client name'
required: true
type: string
UNIT_TESTS_PATH:
required: false
type: string
default: "./..."
GO111MODULE:
required: true
type: string
CGO_ENABLED:
type: number
default: 1
jobs:
unit-tests:
if: ${{ github.actor != 'kubescape' }}
name: Create cross-platform build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-large
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-go@v4
name: Installing go
with:
go-version: ${{ inputs.GO_VERSION }}
- name: Test core pkg
run: ${{ env.DOCKER_CMD }} go test -v ./...
if: startsWith(github.ref, 'refs/tags')
- name: Test httphandler pkg
run: ${{ env.DOCKER_CMD }} sh -c 'cd httphandler && go test -v ./...'
if: startsWith(github.ref, 'refs/tags')
- uses: anchore/sbom-action/download-syft@v0
name: Setup Syft
- uses: goreleaser/goreleaser-action@v6
name: Build
with:
distribution: goreleaser
version: latest
args: build --clean --snapshot --single-target
env:
RELEASE: ${{ inputs.RELEASE }}
CLIENT: ${{ inputs.CLIENT }}
CGO_ENABLED: ${{ inputs.CGO_ENABLED }}
- name: Smoke Testing
env:
RELEASE: ${{ inputs.RELEASE }}
KUBESCAPE_SKIP_UPDATE_CHECK: "true"
run: ${{ env.DOCKER_CMD }} python3 smoke_testing/init.py ${PWD}/dist/cli_linux_amd64_v1/kubescape
- name: golangci-lint
continue-on-error: false
uses: golangci/golangci-lint-action@v9
with:
args: --timeout 10m
only-new-issues: true

View File

@@ -1,53 +0,0 @@
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: mkdir build && go mod tidy && go build -ldflags "-w -s" -o build/kubescape
- name: Chmod
run: chmod +x build/kubescape
- name: List
run: ls -la
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v0.0.${{ github.run_number }}
release_name: Release v0.0.${{ github.run_number }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: build/kubescape
asset_name: kubescape
asset_content_type: application/octet-stream

20
.github/workflows/comments.yaml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: pr-agent
permissions: read-all
on:
issue_comment:
jobs:
pr_agent:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
name: Run pr agent on every pull request, respond to user comments
steps:
- name: PR Agent action step
continue-on-error: true
id: pragent
uses: Codium-ai/pr-agent@main
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

72
.github/workflows/scorecard.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '0 00 * * 1'
push:
branches: [ "master" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@v2.4.3
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

19
.gitignore vendored
View File

@@ -1,3 +1,18 @@
*.vs*
*go.sum*
*kubescape*
*kubescape*
!*Dockerfile*
*debug*
*vendor*
*.pyc*
.idea
.history
ca.srl
*.out
ks
cosign.key
dist/
# Test output files
customFilename.pdf
customFilename.xml

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
[submodule "vendor/github.com/armosec/capacketsgo"]
path = vendor/github.com/armosec/capacketsgo
url = git@github.com:armosec/capacketsgo.git
branch = master

57
.golangci.yml Normal file
View File

@@ -0,0 +1,57 @@
version: "2"
linters:
enable:
- bodyclose
- gosec
- nolintlint
disable:
- dupl
- errcheck
- gochecknoglobals
- gochecknoinits
- gocognit
- gocritic
- lll
- nakedret
- revive
- unconvert
- unparam
settings:
dupl:
threshold: 200
gocognit:
min-complexity: 65
goconst:
min-len: 3
min-occurrences: 2
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- revive
text: var-naming
- linters:
- revive
text: type name will be used as (.+?) by other packages, and that stutters
- linters:
- staticcheck
text: ST1003
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

148
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,148 @@
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
- go test -v ./...
- go -C httphandler test -v ./...
archives:
- id: cli
ids:
- cli
formats:
- binary
- tar.gz
builds:
- id: cli
binary: kubescape
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ldflags:
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X github.com/kubescape/backend/pkg/versioncheck.Client={{.Env.CLIENT}}
hooks:
post:
- cmd: >
{{ if eq .Arch "amd64" }}
/bin/sh -lc 'sh build/goreleaser-post-e2e.sh'
{{ end }}
- id: downloader
dir: downloader
binary: downloader
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- id: http
dir: httphandler
binary: ksserver
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
nfpms:
- id: cli
package_name: kubescape
ids:
- cli
vendor: Kubescape
homepage: https://kubescape.io/
maintainer: matthiasb@kubescape.io
formats:
- apk
- deb
- rpm
bindir: /usr/bin
docker_signs:
- stdin: "{{ .Env.COSIGN_PWD }}"
dockers_v2:
- id: cli
images:
- "quay.io/kubescape/kubescape-cli"
tags:
- "{{ .Tag }}"
labels:
"org.opencontainers.image.description": "Kubescape CLI"
"org.opencontainers.image.created": "{{.Date}}"
"org.opencontainers.image.name": "{{.ProjectName}}"
"org.opencontainers.image.revision": "{{.FullCommit}}"
"org.opencontainers.image.version": "{{.Version}}"
"org.opencontainers.image.source": "{{.GitURL}}"
ids:
- cli
dockerfile: build/kubescape-cli.Dockerfile
- id: http
images:
- "quay.io/kubescape/kubescape"
tags:
- "{{ .Tag }}"
labels:
"org.opencontainers.image.description": "Kubescape microservice"
"org.opencontainers.image.created": "{{.Date}}"
"org.opencontainers.image.name": "{{.ProjectName}}"
"org.opencontainers.image.revision": "{{.FullCommit}}"
"org.opencontainers.image.version": "{{.Version}}"
"org.opencontainers.image.source": "{{.GitURL}}"
ids:
- downloader
- http
dockerfile: build/Dockerfile
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
checksum:
name_template: "checksums.sha256"
sboms:
- artifacts: binary
krews:
- name: kubescape
ids:
- cli
skip_upload: true
homepage: https://kubescape.io/
description: It includes risk analysis, security compliance, and misconfiguration scanning with an easy-to-use CLI interface, flexible output formats, and automated scanning capabilities.
short_description: Scan resources and cluster configs against security frameworks.
release:
draft: false
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

60
.krew.yaml Normal file
View File

@@ -0,0 +1,60 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: kubescape
spec:
version: {{ .TagName }}
platforms:
- selector:
matchLabels:
os: linux
arch: amd64
{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_linux_amd64.tar.gz" .TagName) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: linux
arch: arm64
{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_linux_arm64.tar.gz" .TagName) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: darwin
arch: amd64
{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_darwin_amd64.tar.gz" .TagName) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: darwin
arch: arm64
{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_darwin_arm64.tar.gz" .TagName) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: windows
arch: amd64
{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_windows_amd64.tar.gz" .TagName) .TagName }}
bin: kubescape.exe
- selector:
matchLabels:
os: windows
arch: arm64
{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_windows_arm64.tar.gz" .TagName) .TagName }}
bin: kubescape.exe
shortDescription: Scan resources and cluster configs against security frameworks.
description: |
Kubescape is the first tool for testing if Kubernetes is deployed securely
according to mitigations and best practices. It includes risk analysis,
security compliance, and misconfiguration scanning with an easy-to-use
CLI interface, flexible output formats, and automated scanning capabilities.
Features:
- Risk analysis: Identify vulnerabilities and security risks in your cluster
- Security compliance: Check your cluster against multiple security frameworks
- Misconfiguration scanning: Detect security misconfigurations in your workloads
- Flexible output: Results in JSON, SARIF, HTML, JUnit, and Prometheus formats
- CI/CD integration: Easily integrate into your CI/CD pipeline
homepage: https://kubescape.io/
caveats: |
Requires kubectl and basic knowledge of Kubernetes.
Run 'kubescape scan' to scan your Kubernetes cluster or manifests.

5
ADOPTERS.md Normal file
View File

@@ -0,0 +1,5 @@
# Adopters
The Kubescape project manages this document in the central project repository.
Go to the [centralized ADOPTERS.md](https://github.com/kubescape/project-governance/blob/main/ADOPTERS.md)

5
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,5 @@
# Code of Conduct
The Kubescape project manages this document in the central project repository.
Go to the [centralized CODE_OF_CONDUCT.md](https://github.com/kubescape/project-governance/blob/main/CODE_OF_CONDUCT.md)

5
COMMUNITY.md Normal file
View File

@@ -0,0 +1,5 @@
# Community
The Kubescape project manages this document in the central project repository.
Go to the [centralized COMMUNITY.md](https://github.com/kubescape/project-governance/blob/main/COMMUNITY.md)

5
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,5 @@
# Contributing
The Kubescape project manages this document in the central project repository.
Go to the [centralized CONTRIBUTING.md](https://github.com/kubescape/project-governance/blob/main/CONTRIBUTING.md)

5
GOVERNANCE.md Normal file
View File

@@ -0,0 +1,5 @@
# Governance
The Kubescape project manages this document in the central project repository.
Go to the [centralized GOVERNANCE.md](https://github.com/kubescape/project-governance/blob/main/GOVERNANCE.md)

273
KREW_RELEASE.md Normal file
View File

@@ -0,0 +1,273 @@
# Krew Release Automation Guide
This document explains how kubescape automates publishing to the Kubernetes plugin package manager, krew.
## What is Krew?
Krew is a plugin manager for `kubectl`. It allows users to discover and install `kubectl` plugins easily. You can learn more about krew at [https://krew.sigs.k8s.io/](https://krew.sigs.k8s.io/).
## How kubescape publishes to krew
We use the [krew-release-bot](https://github.com/rajatjindal/krew-release-bot) to automatically create pull requests to the [kubernetes-sigs/krew-index](https://github.com/kubernetes-sigs/krew-index) repository whenever a new release of kubescape is published.
### Setup Overview
The automation consists of three components:
1. **`.krew.yaml`** - A template file that the bot uses to generate the krew plugin manifest
2. **`.github/workflows/02-release.yaml`** - GitHub Actions workflow that runs the krew-release-bot after a successful release
3. **`.goreleaser.yaml`** - GoReleaser configuration that defines the krew manifest (though upload is skipped)
### Why Use krew-release-bot Instead of GoReleaser's Built-in Krew Support?
You might have noticed that **GoReleaser has built-in krew support** in its `krews` section. However, almost all projects (including stern) use `skip_upload: true` and rely on **krew-release-bot** instead. Here's why:
#### Problems with GoReleaser's Built-in Krew Publishing
To use GoReleaser's direct krew publishing, you would need to:
```yaml
krews:
- name: kubescape
skip_upload: false # Instead of true
repository:
owner: kubernetes-sigs
name: krew-index
token: "{{ .Env.KREW_INDEX_TOKEN }}" # Required!
pull_request:
enabled: true # Requires GoReleaser Pro for cross-repo PRs
```
This approach has several critical issues:
1. **Permission Barrier**: Almost no one has write access to `kubernetes-sigs/krew-index`. You would need special permissions from the Krew maintainers, which is rarely granted.
2. **Security Risk**: You'd need to store a GitHub personal access token with write access to the krew-index in your repository secrets. This token could be compromised and used to make unauthorized changes to the krew-index.
3. **GoReleaser Pro Required**: To create pull requests to a different repository (cross-repository), you need GoReleaser Pro, which is a paid product.
4. **Manual Work**: Even if you had access, you'd need to manually configure and maintain the repository settings, tokens, and potentially deal with rate limits and authentication issues.
#### Why krew-release-bot is the Right Solution
The **krew-release-bot** was created by the Kubernetes community (in collaboration with the Krew team) specifically to solve these problems:
- **No Repository Access Required**: The bot acts as an intermediary with pre-configured access to krew-index. You don't need write permissions.
- **No Tokens Needed**: It uses GitHub's `GITHUB_TOKEN` (automatically available in GitHub Actions) via webhooks and events. No personal access tokens required.
- **Designed for Krew**: It's specifically built for the krew-index workflow and integrates with Krew's automation.
- **Automatic Merging**: The Krew team has configured their CI to automatically test and merge PRs from krew-release-bot (usually within 5-10 minutes).
- **Officially Recommended**: The Krew team explicitly recommends this approach in their documentation as the standard way to automate plugin updates.
- **Free and Open Source**: No paid subscriptions required.
#### The Real-World Evidence
Looking at recent pull requests to `kubernetes-sigs/krew-index`, **almost all automated plugin updates are created by krew-release-bot**. You'll see patterns like:
```
Author: krew-release-bot
Title: "release new version v0.6.11 of radar"
```
This demonstrates that the entire Kubernetes ecosystem has standardized on krew-release-bot, not GoReleaser's built-in publishing.
#### Summary
While GoReleaser's built-in krew support exists in the code, it's **practically unusable for the krew-index repository** due to permission and security constraints. The krew-release-bot is the de facto standard because:
- It works without special permissions
- It's more secure
- It integrates with Krew's automation
- It's free and recommended by the Krew team
This is why we use `skip_upload: true` in GoReleaser and let krew-release-bot handle the actual publishing.
### The Template File
The `.krew.yaml` file in the repository root is a Go template that contains placeholders for dynamic values:
```yaml
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: kubescape
spec:
version: {{ .TagName }}
platforms:
- selector:
matchLabels:
os: linux
arch: amd64
{{ $version := trimPrefix "v" .TagName }}{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_linux_amd64.tar.gz" $version) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: linux
arch: arm64
{{ $version := trimPrefix "v" .TagName }}{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_linux_arm64.tar.gz" $version) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: darwin
arch: amd64
{{ $version := trimPrefix "v" .TagName }}{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_darwin_amd64.tar.gz" $version) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: darwin
arch: arm64
{{ $version := trimPrefix "v" .TagName }}{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_darwin_arm64.tar.gz" $version) .TagName }}
bin: kubescape
- selector:
matchLabels:
os: windows
arch: amd64
{{ $version := trimPrefix "v" .TagName }}{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_windows_amd64.tar.gz" $version) .TagName }}
bin: kubescape.exe
- selector:
matchLabels:
os: windows
arch: arm64
{{ $version := trimPrefix "v" .TagName }}{{ addURIAndSha "https://github.com/kubescape/kubescape/releases/download/" .TagName (printf "kubescape_%s_windows_arm64.tar.gz" $version) .TagName }}
bin: kubescape.exe
shortDescription: Scan resources and cluster configs against security frameworks.
description: |
Kubescape is the first tool for testing if Kubernetes is deployed securely
according to mitigations and best practices. It includes risk analysis,
security compliance, and misconfiguration scanning with an easy-to-use
CLI interface, flexible output formats, and automated scanning capabilities.
Features:
- Risk analysis: Identify vulnerabilities and security risks in your cluster
- Security compliance: Check your cluster against multiple security frameworks
- Misconfiguration scanning: Detect security misconfigurations in your workloads
- Flexible output: Results in JSON, SARIF, HTML, JUnit, and Prometheus formats
- CI/CD integration: Easily integrate into your CI/CD pipeline
homepage: https://kubescape.io/
caveats: |
Requires kubectl and basic knowledge of Kubernetes.
Run 'kubescape scan' to scan your Kubernetes cluster or manifests.
```
The `{{ .TagName }}` is replaced with the release tag (e.g., `v3.0.0`), `{{ trimPrefix "v" .TagName }}` removes the version prefix, and `{{ addURIAndSha ... }}` calculates the SHA256 checksum for the binary archive.
### Release Workflow
The release workflow (`.github/workflows/02-release.yaml`) can be triggered in two ways:
1. **Automatic**: When a new tag matching the pattern `v[0-9]+.[0-9]+.[0-9]+` is pushed to the repository
2. **Manual**: Via `workflow_dispatch` with an optional `skip_publish` input
When the workflow is triggered:
1. GoReleaser builds and publishes the release artifacts (unless `skip_publish=true` is set)
2. The krew-release-bot step runs conditionally:
- It **runs** when triggered by a tag push OR by `workflow_dispatch` with `skip_publish=false`
- It **skips** when triggered by `workflow_dispatch` with `skip_publish=true` (default)
3. When it runs, the bot:
- Reads the `.krew.yaml` template
- Fills in the template with release information
- Creates a pull request to the `kubernetes-sigs/krew-index` repository
- The PR is automatically tested and merged by krew's infrastructure
### Workflow Permissions
The release job has the following permissions:
```yaml
permissions:
actions: read
checks: read
contents: write
deployments: read
discussions: read
id-token: write
issues: read
models: read
packages: write
pages: read
pull-requests: read
repository-projects: read
statuses: read
security-events: read
attestations: read
artifact-metadata: read
```
These permissions are necessary for GoReleaser to create releases and upload artifacts.
### Testing the Template
Before committing changes to `.krew.yaml`, you can test how the template will be rendered using Docker:
```bash
docker run -v $(pwd)/.krew.yaml:/tmp/.krew.yaml ghcr.io/rajatjindal/krew-release-bot:v0.0.47 \
krew-release-bot template --tag v3.0.0 --template-file /tmp/.krew.yaml
```
This will output the generated krew manifest file, allowing you to verify:
- The version field is correct
- All download URLs are properly formatted
- The SHA256 checksum will be calculated correctly
### Why skip_upload in GoReleaser?
In `.goreleaser.yaml`, the `krews` section has `skip_upload: true`:
```yaml
krews:
- name: kubescape
ids:
- cli
skip_upload: true # We use krew-release-bot instead
homepage: https://kubescape.io/
description: It includes risk analysis, security compliance, and misconfiguration scanning with an easy-to-use CLI interface, flexible output formats, and automated scanning capabilities.
short_description: Scan resources and cluster configs against security frameworks.
```
This is intentional because:
- GoReleaser generates the manifest but doesn't have built-in support for submitting PRs to krew-index
- krew-release-bot is the recommended tool for krew automation by the Krew team
- Using krew-release-bot provides automatic testing and merging of version bump PRs
### Manual Release Testing
You can test the release workflow manually without publishing to krew by using `workflow_dispatch`:
1. Go to Actions tab in GitHub
2. Select "02-create_release" workflow
3. Click "Run workflow"
4. The `skip_publish` input defaults to `true` (publishing will be skipped)
5. Set `skip_publish` to `false` if you want to test the full release process including krew indexing
### Making Changes to the Template
If you need to update the krew manifest (e.g., change the description, add platforms, or update the binary location):
1. Edit the `.krew.yaml` file
2. Test your changes with the Docker command shown above
3. Commit and push the changes
4. The next release will use the updated template
### Installing kubescape via krew
Once the plugin is indexed in krew, users can install it with:
```bash
kubectl krew install kubernetes-sigs/kubescape
```
Or after index update:
```bash
kubectl krew install kubescape
```
### Further Reading
- [Krew official documentation](https://krew.sigs.k8s.io/docs/developer-guide/)
- [krew-release-bot repository](https://github.com/rajatjindal/krew-release-bot)
- [Krew plugin submission guide](https://krew.sigs.k8s.io/docs/developer-guide/develop/plugins/)

View File

@@ -1,3 +1,4 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

5
MAINTAINERS.md Normal file
View File

@@ -0,0 +1,5 @@
# Maintainers
The Kubescape project manages this document in the central project repository.
Go to the [centralized MAINTAINERS.md](https://github.com/kubescape/project-governance/blob/main/MAINTAINERS.md)

12
Makefile Normal file
View File

@@ -0,0 +1,12 @@
.PHONY: test all build
# default task invoked while running make
all: build
export CGO_ENABLED=0
build:
go build -v .
test:
go test -v ./...

520
README.md
View File

@@ -1,56 +1,500 @@
<img src="docs/kubescape.png" width="300" alt="logo" align="center">
[![Version](https://img.shields.io/github/v/release/kubescape/kubescape)](https://github.com/kubescape/kubescape/releases)
[![build](https://github.com/kubescape/kubescape/actions/workflows/02-release.yaml/badge.svg)](https://github.com/kubescape/kubescape/actions/workflows/02-release.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubescape/kubescape)](https://goreportcard.com/report/github.com/kubescape/kubescape)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/kubescape/kubescape)
[![GitHub](https://img.shields.io/github/license/kubescape/kubescape)](https://github.com/kubescape/kubescape/blob/master/LICENSE)
[![CNCF](https://shields.io/badge/CNCF-Incubating%20project-blue?logo=linux-foundation&style=flat)](https://landscape.cncf.io/?item=provisioning--security-compliance--kubescape)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubescape)](https://artifacthub.io/packages/search?repo=kubescape)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkubescape%2Fkubescape.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkubescape%2Fkubescape?ref=badge_shield&issueType=license)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/6944/badge)](https://www.bestpractices.dev/projects/6944)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kubescape/kubescape/badge)](https://securityscorecards.dev/viewer/?uri=github.com/kubescape/kubescape)
[![Docs](https://img.shields.io/badge/docs-latest-brightgreen?logo=gitbook)](https://kubescape.io/docs/)
[![Stars](https://img.shields.io/github/stars/kubescape/kubescape?style=social)](https://github.com/kubescape/kubescape/stargazers)
[![Twitter Follow](https://img.shields.io/twitter/follow/kubescape?style=social)](https://twitter.com/kubescape)
[![Slack](https://img.shields.io/badge/slack-kubescape-blueviolet?logo=slack)](https://cloud-native.slack.com/archives/C04EY3ZF9GE)
Kubescape is the first tool for testing if Kubernetes is deployed securely as defined in [Kubernetes Hardening Guidance by to NSA and CISA](https://www.nsa.gov/News-Features/Feature-Stories/Article-View/Article/2716980/nsa-cisa-release-kubernetes-hardening-guidance/)
Tests are configured with YAML files, making this tool easy to update as test specifications evolve.
# Kubescape
<img src="docs/using-mov.gif">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/cncf/artwork/master/projects/kubescape/stacked/white/kubescape-stacked-white.svg" width="150">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/cncf/artwork/master/projects/kubescape/stacked/color/kubescape-stacked-color.svg" width="150">
<img alt="Kubescape logo" align="right" src="https://raw.githubusercontent.com/cncf/artwork/master/projects/kubescape/stacked/color/kubescape-stacked-color.svg" width="150">
</picture>
# TL;DR
## Installation
To install the tool locally, run this:
_Comprehensive Kubernetes Security from Development to Runtime_
`curl -s https://raw.githubusercontent.com/armosec/kubescape/master/install.sh | /bin/bash`
Kubescape is an open-source Kubernetes security platform that provides comprehensive security coverage, from left to right across the entire development and deployment lifecycle. It offers hardening, posture management, and runtime security capabilities to ensure robust protection for Kubernetes environments.
<img src="docs/install.jpeg">
Kubescape was created by [ARMO](https://www.armosec.io/?utm_source=github&utm_medium=repository) and is a [Cloud Native Computing Foundation (CNCF) incubating project](https://www.cncf.io/projects/).
## Run
To get a fast check of the security posture of your Kubernetes cluster, run this:
_Please [star ⭐](https://github.com/kubescape/kubescape/stargazers) the repo if you want us to continue developing and improving Kubescape!_
`kubescape scan framework nsa`
---
<img src="docs/run.jpeg">
## 📑 Table of Contents
- [Features](#-features)
- [Demo](#-demo)
- [Quick Start](#-quick-start)
- [Installation](#-installation)
- [CLI Commands](#%EF%B8%8F-cli-commands)
- [Usage Examples](#-usage-examples)
- [Architecture](#%EF%B8%8F-architecture)
- [In-Cluster Operator](#%EF%B8%8F-in-cluster-operator)
- [Integrations](#-integrations)
- [Community](#-community)
- [Changelog](#changelog)
- [License](#license)
# Status
[![build](https://github.com/armosec/kubescape/actions/workflows/build.yaml/badge.svg)](https://github.com/armosec/kubescape/actions/workflows/build.yaml)
---
# How to build
`go mod tidy && go build -o kubescape` :zany_face:
## ✨ Features
# Under the hood
| Feature | Description |
|---------|-------------|
| 🔍 **Misconfiguration Scanning** | Scan clusters, YAML files, and Helm charts against NSA-CISA, MITRE ATT&CK®, and CIS Benchmarks |
| 🐳 **Image Vulnerability Scanning** | Detect CVEs in container images using [Grype](https://github.com/anchore/grype) |
| 🩹 **Image Patching** | Automatically patch vulnerable images using [Copacetic](https://github.com/project-copacetic/copacetic) |
| 🔧 **Auto-Remediation** | Automatically fix misconfigurations in Kubernetes manifests |
| 🛡️ **Admission Control** | Enforce security policies with Validating Admission Policies (VAP) |
| 📊 **Runtime Security** | eBPF-based runtime monitoring via [Inspektor Gadget](https://github.com/inspektor-gadget) |
| 🤖 **AI Integration** | MCP server for AI assistant integration |
## Tests
Kubescape is running the following tests according to what is defined by [Kubernetes Hardening Guidance by to NSA and CISA](https://www.nsa.gov/News-Features/Feature-Stories/Article-View/Article/2716980/nsa-cisa-release-kubernetes-hardening-guidance/)
* Non-root containers
* Immutable container filesystem
* Building secure container images
* Privileged containers
* hostPID, hostIPC privileges
* hostNetwork access
* allowedHostPaths field
* Protecting pod service account tokens
* Pods in kube-system and kube-public
* Resource policies
* Control plane hardening
* Encrypted secrets
* Anonymous Requests
---
## 🎬 Demo
## Technology
Kubescape based on OPA engine: https://github.com/open-policy-agent/opa and ARMO's posture controls.
<img src="docs/img/demo-v3.gif" alt="Kubescape CLI demo">
The tools retrieves Kubernetes objects from the API server and runs a set of [regos snippets](https://www.openpolicyagent.org/docs/latest/policy-language/) developed by [ARMO](https://www.armosec.io/).
---
The results by default printed in a pretty "console friendly" manner, but they can be retrieved in JSON format for further processing.
## 🚀 Quick Start
Kubescape is an open source project, we welcome your feedback and ideas for improvement. Were also aiming to collaborate with the Kubernetes community to help make the tests themselves more robust and complete as Kubernetes develops.
### 1. Install Kubescape
```sh
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash
```
> 💡 See [Installation](#-installation) for more options (Homebrew, Krew, Windows, etc.)
### 2. Run Your First Scan
```sh
# Scan your current cluster
kubescape scan
# Scan a specific YAML file or directory
kubescape scan /path/to/manifests/
# Scan a container image for vulnerabilities
kubescape scan image nginx:latest
```
### 3. Explore the Results
Kubescape provides a detailed security posture overview including:
- Control plane security status
- Access control risks
- Workload misconfigurations
- Network policy gaps
- Compliance scores (MITRE, NSA)
---
## 📦 Installation
### One-Line Install (Linux/macOS)
```bash
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash
```
### Package Managers
| Platform | Command |
|----------|---------|
| **Homebrew** | `brew install kubescape` |
| **Krew** | `kubectl krew install kubescape` |
| **Arch Linux** | `yay -S kubescape` |
| **Ubuntu** | `sudo add-apt-repository ppa:kubescape/kubescape && sudo apt install kubescape` |
| **NixOS** | `nix-shell -p kubescape` |
| **Chocolatey** | `choco install kubescape` |
| **Scoop** | `scoop install kubescape` |
### Windows (PowerShell)
```powershell
iwr -useb https://raw.githubusercontent.com/kubescape/kubescape/master/install.ps1 | iex
```
📖 **[Full Installation Guide →](docs/installation.md)**
---
## 🛠️ CLI Commands
Kubescape provides a comprehensive CLI with the following commands:
| Command | Description |
|---------|-------------|
| [`kubescape scan`](#scanning) | Scan cluster, files, or images for security issues |
| [`kubescape scan image`](#image-scanning) | Scan container images for vulnerabilities |
| [`kubescape fix`](#auto-fix) | Auto-fix misconfigurations in manifest files |
| [`kubescape patch`](#image-patching) | Patch container images to fix vulnerabilities |
| [`kubescape list`](#list-frameworks-and-controls) | List available frameworks and controls |
| [`kubescape download`](#offline-support) | Download artifacts for offline/air-gapped use |
| [`kubescape config`](#configuration) | Manage cached configurations |
| [`kubescape operator`](#operator-commands) | Interact with in-cluster Kubescape operator |
| [`kubescape vap`](#validating-admission-policies) | Manage Validating Admission Policies |
| [`kubescape mcpserver`](#mcp-server) | Start MCP server for AI assistant integration |
| `kubescape completion` | Generate shell completion scripts |
| `kubescape version` | Display version information |
---
## 📖 Usage Examples
### Scanning
#### Scan a Running Cluster
```bash
# Default scan (all frameworks)
kubescape scan
# Scan with a specific framework
kubescape scan framework nsa
kubescape scan framework mitre
kubescape scan framework cis-v1.23-t1.0.1
# Scan a specific control
kubescape scan control C-0005 -v
```
#### Scan Files and Repositories
```bash
# Scan local YAML files
kubescape scan /path/to/manifests/
# Scan a Helm chart
kubescape scan /path/to/helm/chart/
# Scan a Git repository
kubescape scan https://github.com/kubescape/kubescape
# Scan with Kustomize
kubescape scan /path/to/kustomize/directory/
```
#### Scan Options
```bash
# Include/exclude namespaces
kubescape scan --include-namespaces production,staging
kubescape scan --exclude-namespaces kube-system,kube-public
# Use alternative kubeconfig
kubescape scan --kubeconfig /path/to/kubeconfig
# Set compliance threshold (exit code 1 if below threshold)
kubescape scan --compliance-threshold 80
# Set severity threshold
kubescape scan --severity-threshold high
```
#### Output Formats
```bash
# JSON output
kubescape scan --format json --output results.json
# JUnit XML (for CI/CD)
kubescape scan --format junit --output results.xml
# SARIF (for GitHub Code Scanning)
kubescape scan --format sarif --output results.sarif
# HTML report
kubescape scan --format html --output report.html
# PDF report
kubescape scan --format pdf --output report.pdf
```
### Image Scanning
```bash
# Scan a public image
kubescape scan image nginx:1.21
# Scan with verbose output
kubescape scan image nginx:1.21 -v
# Scan a private registry image
kubescape scan image myregistry/myimage:tag --username user --password pass
```
### Auto-Fix
Automatically fix misconfigurations in your manifest files:
```bash
# First, scan and save results to JSON
kubescape scan /path/to/manifests --format json --output results.json
# Then apply fixes
kubescape fix results.json
# Dry run (preview changes without applying)
kubescape fix results.json --dry-run
# Apply fixes without confirmation prompts
kubescape fix results.json --no-confirm
```
### Image Patching
Patch container images to fix OS-level vulnerabilities:
```bash
# Start buildkitd (required)
sudo buildkitd &
# Patch an image
sudo kubescape patch --image docker.io/library/nginx:1.22
# Specify custom output tag
sudo kubescape patch --image nginx:1.22 --tag nginx:1.22-patched
# See detailed vulnerability report
sudo kubescape patch --image nginx:1.22 -v
```
📖 **[Full Patch Command Documentation →](cmd/patch/README.md)**
### List Frameworks and Controls
```bash
# List available frameworks
kubescape list frameworks
# List all controls
kubescape list controls
# Output as JSON
kubescape list controls --format json
```
### Offline Support
Download artifacts for air-gapped environments:
```bash
# Download all artifacts
kubescape download artifacts --output /path/to/offline/dir
# Download a specific framework
kubescape download framework nsa --output /path/to/nsa.json
# Scan using downloaded artifacts
kubescape scan --use-artifacts-from /path/to/offline/dir
```
### Configuration
```bash
# View current configuration
kubescape config view
# Set account ID
kubescape config set accountID <your-account-id>
# Delete cached configuration
kubescape config delete
```
### Operator Commands
Interact with the in-cluster Kubescape operator:
```bash
# Trigger a configuration scan
kubescape operator scan configurations
# Trigger a vulnerability scan
kubescape operator scan vulnerabilities
```
### Validating Admission Policies
Manage Kubernetes Validating Admission Policies:
```bash
# Deploy the Kubescape CEL admission policy library
kubescape vap deploy-library | kubectl apply -f -
# Create a policy binding
kubescape vap create-policy-binding \
--name my-policy-binding \
--policy c-0016 \
--namespace my-namespace | kubectl apply -f -
```
### MCP Server
Start an MCP (Model Context Protocol) server for AI assistant integration:
```bash
kubescape mcpserver
```
The MCP server exposes Kubescape's vulnerability and configuration scan data to AI assistants, enabling natural language queries about your cluster's security posture.
**Available MCP Tools:**
- `list_vulnerability_manifests` - Discover vulnerability manifests
- `list_vulnerabilities_in_manifest` - List CVEs in a manifest
- `list_vulnerability_matches_for_cve` - Get details for a specific CVE
- `list_configuration_security_scan_manifests` - List configuration scan results
- `get_configuration_security_scan_manifest` - Get configuration scan details
---
## 🏗️ Architecture
Kubescape can run in two modes:
### CLI Mode
The CLI is a standalone tool that scans clusters, files, and images on-demand.
<div align="center">
<img src="docs/img/ks-cli-arch.png" width="600" alt="CLI Architecture">
</div>
**Key Components:**
- **[Open Policy Agent (OPA)](https://github.com/open-policy-agent/opa)** - Policy evaluation engine
- **[Regolibrary](https://github.com/kubescape/regolibrary)** - Library of security controls
- **[Grype](https://github.com/anchore/grype)** - Image vulnerability scanning
- **[Copacetic](https://github.com/project-copacetic/copacetic)** - Image patching
### Operator Mode (In-Cluster)
For continuous monitoring, deploy the Kubescape operator via Helm.
<div align="center">
<img src="docs/img/ks-operator-arch.png" width="600" alt="Operator Architecture">
</div>
**Additional Capabilities:**
- Continuous configuration scanning
- Image vulnerability scanning
- Runtime analysis with eBPF
- Network policy generation
📖 **[Full Architecture Documentation →](docs/architecture.md)**
---
## ☸️ In-Cluster Operator
The Kubescape operator provides continuous security monitoring in your cluster:
```bash
# Add the Kubescape Helm repository
helm repo add kubescape https://kubescape.github.io/helm-charts/
# Install the operator
helm upgrade --install kubescape kubescape/kubescape-operator \
--namespace kubescape \
--create-namespace
```
**Operator Features:**
- 🔄 Continuous misconfiguration scanning
- 🐳 Image vulnerability scanning for all workloads
- 🔍 Runtime threat detection (eBPF-based)
- 🌐 Network policy generation
- 📈 Prometheus metrics integration
📖 **[Operator Installation Guide →](https://kubescape.io/docs/operator/)**
---
## 🔌 Integrations
### CI/CD
| Platform | Integration |
|----------|-------------|
| **GitHub Actions** | [kubescape/github-action](https://github.com/marketplace/actions/kubescape) |
| **GitLab CI** | [Documentation](https://kubescape.io/docs/integrations/gitlab/) |
| **Jenkins** | [Documentation](https://kubescape.io/docs/integrations/jenkins/) |
### IDE Extensions
| IDE | Extension |
|-----|-----------|
| **VS Code** | [Kubescape Extension](https://marketplace.visualstudio.com/items?itemName=kubescape.kubescape) |
| **Lens** | [Kubescape Lens Extension](https://github.com/armosec/lens-kubescape) |
### Where You Can Use Kubescape
<div align="center">
<img src="docs/img/ksfromcodetodeploy.png" alt="Kubescape integration points: IDE, CI, CD, Runtime">
</div>
---
## 👥 Community
Kubescape is a CNCF incubating project with an active community.
### Get Involved
- 💬 **[Slack - Users Channel](https://cloud-native.slack.com/archives/C04EY3ZF9GE)** - Ask questions, get help
- 💬 **[Slack - Developers Channel](https://cloud-native.slack.com/archives/C04GY6H082K)** - Contribute to development
- 🐛 **[GitHub Issues](https://github.com/kubescape/kubescape/issues)** - Report bugs and request features
- 📋 **[Project Board](https://github.com/orgs/kubescape/projects/4)** - See what we're working on
- 🗺️ **[Roadmap](https://github.com/kubescape/project-governance/blob/main/ROADMAP.md)** - Future plans
### Contributing
We welcome contributions! Please see our:
- **[Contributing Guide](https://github.com/kubescape/project-governance/blob/main/CONTRIBUTING.md)**
- **[Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)**
### Community Resources
- **[Community Info](https://github.com/kubescape/project-governance/blob/main/COMMUNITY.md)**
- **[Governance](https://github.com/kubescape/project-governance/blob/main/GOVERNANCE.md)**
- **[Security Policy](https://github.com/kubescape/project-governance/blob/main/SECURITY.md)**
- **[Maintainers](https://github.com/kubescape/project-governance/blob/main/MAINTAINERS.md)**
### Contributors
<a href="https://github.com/kubescape/kubescape/graphs/contributors">
<img src="https://contrib.rocks/image?repo=kubescape/kubescape"/>
</a>
---
## Changelog
Kubescape changes are tracked on the [releases page](https://github.com/kubescape/kubescape/releases).
---
## License
Copyright 2021-2025, the Kubescape Authors. All rights reserved.
Kubescape is released under the [Apache 2.0 license](LICENSE).
Kubescape is a [Cloud Native Computing Foundation (CNCF) incubating project](https://www.cncf.io/projects/kubescape/) and was contributed by [ARMO](https://www.armosec.io/?utm_source=github&utm_medium=repository).
<div align="center">
<img src="https://raw.githubusercontent.com/cncf/artwork/refs/heads/main/other/cncf-member/incubating/color/cncf-incubating-color.svg" width="300" alt="CNCF Incubating Project">
</div>

56
SECURITY-INSIGHTS.yml Normal file
View File

@@ -0,0 +1,56 @@
header:
schema-version: 1.0.0
last-updated: '2023-10-12'
last-reviewed: '2023-10-12'
expiration-date: '2024-10-12T01:00:00.000Z'
project-url: https://github.com/kubescape/kubescape/
project-release: 1.0.0
project-lifecycle:
status: active
bug-fixes-only: false
core-maintainers:
- github:amirmalka
- github:amitschendel
- github:bezbran
- github:craigbox
- github:dwertent
- github:matthyx
- github:rotemamsa
- github:slashben
contribution-policy:
accepts-pull-requests: true
accepts-automated-pull-requests: false
code-of-conduct: https://github.com/kubescape/kubescape/blob/master/CODE_OF_CONDUCT.md
dependencies:
third-party-packages: true
dependencies-lists:
- https://github.com/kubescape/kubescape/blob/master/go.mod
- https://github.com/kubescape/kubescape/blob/master/httphandler/go.mod
env-dependencies-policy:
policy-url: https://github.com/kubescape/kubescape/blob/master/docs/environment-dependencies-policy.md
documentation:
- https://github.com/kubescape/kubescape/tree/master/docs
distribution-points:
- https://github.com/kubescape/kubescape/
security-artifacts:
threat-model:
threat-model-created: false
security-testing:
- tool-type: sca
tool-name: Dependabot
tool-version: latest
integration:
ad-hoc: false
ci: true
before-release: true
comment: |
Dependabot is enabled for this repo.
security-contacts:
- type: email
value: cncf-kubescape-maintainers@lists.cncf.io
vulnerability-reporting:
accepts-vulnerability-reports: true
security-policy: https://github.com/kubescape/kubescape/security/policy
email-contact: cncf-kubescape-maintainers@lists.cncf.io
comment: |
The first and best way to report a vulnerability is by using private security issues in GitHub.

5
SECURITY.md Normal file
View File

@@ -0,0 +1,5 @@
# Security
The Kubescape project manages this document in the central project repository.
Go to the [centralized SECURITY.md](https://github.com/kubescape/project-governance/blob/main/SECURITY.md)

14
build/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM gcr.io/distroless/static-debian13:nonroot
USER nonroot
WORKDIR /home/nonroot/
ARG TARGETPLATFORM
COPY $TARGETPLATFORM/downloader /usr/bin/downloader
RUN ["downloader"]
COPY $TARGETPLATFORM/ksserver /usr/bin/ksserver
ARG image_version client
ENV RELEASE=$image_version CLIENT=$client
ENTRYPOINT ["ksserver"]

View File

@@ -0,0 +1,2 @@
.git
kubescape*

241
build/README.md Normal file
View File

@@ -0,0 +1,241 @@
# Building Kubescape
This guide covers how to build Kubescape from source.
## Table of Contents
- [Prerequisites](#prerequisites)
- [Building the CLI](#building-the-cli)
- [Building Docker Images](#building-docker-images)
- [Build Options](#build-options)
- [Development Setup](#development-setup)
- [Troubleshooting](#troubleshooting)
---
## Prerequisites
### Required
- **Go 1.23+** - [Installation Guide](https://golang.org/doc/install)
- **Git** - For cloning the repository
- **Make** - For running build commands
### Optional (for Docker builds)
- **Docker** - [Installation Guide](https://docs.docker.com/get-docker/)
- **Docker Buildx** - For multi-platform builds (included with Docker Desktop)
- **GoReleaser** - [Installation Guide](https://goreleaser.com/install/)
### Verify Prerequisites
```bash
go version # Should be 1.23 or higher
git --version
make --version
docker --version # Optional
goreleaser --version # Optional
```
---
## Building the CLI
### Clone the Repository
```bash
git clone https://github.com/kubescape/kubescape.git
cd kubescape
```
### Build with Make
```bash
# Build for your current platform
make build
# The binary will be at ./kubescape
./kubescape version
```
### Build Directly with Go
```bash
go build -o kubescape .
```
### Build with GoReleaser
```bash
# Build for your current platform
RELEASE=v0.0.1 CLIENT=local goreleaser build --snapshot --clean --single-target
```
### Cross-Compilation
Build for different platforms:
```bash
# Linux (amd64)
GOOS=linux GOARCH=amd64 go build -o kubescape-linux-amd64 .
# Linux (arm64)
GOOS=linux GOARCH=arm64 go build -o kubescape-linux-arm64 .
# macOS (amd64)
GOOS=darwin GOARCH=amd64 go build -o kubescape-darwin-amd64 .
# macOS (arm64 / Apple Silicon)
GOOS=darwin GOARCH=arm64 go build -o kubescape-darwin-arm64 .
# Windows (amd64)
GOOS=windows GOARCH=amd64 go build -o kubescape-windows-amd64.exe .
```
---
## Building Docker Images
Kubescape uses [GoReleaser](https://goreleaser.com/) to build its Docker images. The Dockerfiles are specifically designed to work with GoReleaser's build pipeline, which handles cross-compilation and places binaries in the expected directory structure.
### Build with GoReleaser
The recommended way to build Docker images locally is using GoReleaser. Note that `RELEASE`, `CLIENT`, and `RUN_E2E` environment variables are required:
```bash
# Build all artifacts and Docker images locally without publishing
# --skip=before,krew,nfpm,sbom skips unnecessary steps for faster local builds
RELEASE=v0.0.1 CLIENT=local RUN_E2E=false goreleaser release --snapshot --clean --skip=before,nfpm,sbom
```
Please read the [GoReleaser documentation](https://goreleaser.com/customization/dockers_v2/#testing-locally) for more details on using it for local testing.
---
## Build Options
### Make Targets
| Target | Description |
|--------|-------------|
| `make build` | Build the Kubescape binary |
| `make test` | Run unit tests |
| `make all` | Build everything |
| `make clean` | Remove build artifacts |
### Build Tags
You can use Go build tags to customize the build:
```bash
# Example with build tags
go build -tags "netgo" -o kubescape .
```
### Version Information
To embed version information in the build:
```bash
VERSION=$(git describe --tags --always)
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
COMMIT=$(git rev-parse HEAD)
go build -ldflags "-X main.version=$VERSION -X main.buildDate=$BUILD_DATE -X main.commit=$COMMIT" -o kubescape .
```
---
## Development Setup
### Install Development Dependencies
```bash
# Install golangci-lint for linting
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Install other tools as needed
go mod download
```
### Run Tests
```bash
# Run all tests
make test
# Run tests with coverage
go test -cover ./...
# Run specific package tests
go test ./core/...
```
### Run Linter
```bash
golangci-lint run
```
### Code Formatting
```bash
go fmt ./...
```
---
## Troubleshooting
### Build Fails with "module not found"
```bash
# Update dependencies
go mod tidy
go mod download
```
### CGO-related Errors
If you encounter CGO errors, try building with CGO disabled:
```bash
CGO_ENABLED=0 go build -o kubescape .
```
### Docker Build Fails
Ensure Docker daemon is running and you have sufficient permissions.
If you encounter an error like `failed to calculate checksum ... "/linux/amd64/kubescape": not found`, it usually means you are trying to run `docker build` manually. Because the Dockerfiles are optimized for GoReleaser, you should use the `goreleaser release --snapshot` command described in the [Building Docker Images](#building-docker-images) section instead.
```bash
# Check Docker status
docker info
```
### Out of Memory During Build
For systems with limited memory:
```bash
# Limit Go's memory usage
GOGC=50 go build -o kubescape .
```
---
## Dockerfiles
| File | Description |
|------|-------------|
| `build/Dockerfile` | Full Kubescape image with HTTP handler |
| `build/kubescape-cli.Dockerfile` | Minimal CLI-only image |
---
## Related Documentation
- [Contributing Guide](https://github.com/kubescape/project-governance/blob/main/CONTRIBUTING.md)
- [Architecture](../docs/architecture.md)
- [Getting Started](../docs/getting-started.md)

View File

@@ -0,0 +1,151 @@
#!/usr/bin/env sh
#
# goreleaser-post-e2e.sh
#
# A small, robust POSIX shell script intended to be called from the goreleaser
# `builds[].hooks.post` entry. It is responsible for optionally running the
# repository smoke tests against the artifact produced in `dist/`.
#
# Usage:
# RUN_E2E=true -> enable running smoke tests
# E2E_FAIL_ON_ERROR=1 -> (default) treat test failures as fatal (exit non-zero)
# E2E_FAIL_ON_ERROR=0 -> treat test failures as non-fatal (log, but exit 0)
#
# The script is written to be defensive and to work under /bin/sh on CI runners.
# Use POSIX-safe flags only.
set -eu
# Helper for logging
_now() {
date --iso-8601=seconds 2>/dev/null || date
}
log() {
printf '%s [goreleaser-post-e2e] %s\n' "$(_now)" "$*"
}
# GitHub Actions log grouping helpers (no-op outside Actions)
gha_group_start() {
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
# Titles must be on a single line
printf '::group::%s\n' "$*"
fi
}
gha_group_end() {
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
printf '::endgroup::\n'
fi
}
# Small helper to interpret various truthy forms (1/true/yes/y)
is_true() {
case "${1:-}" in
1|true|TRUE|yes|YES|y|Y) return 0 ;;
*) return 1 ;;
esac
}
# Determine repo root relative to this script (script is expected to live in kubescape/build/)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
: "${RUN_E2E:=false}"
# Default to fatal E2E failures.
: "${E2E_FAIL_ON_ERROR:=1}"
log "Starting goreleaser post-build e2e script"
log "RUN_E2E=${RUN_E2E}"
log "E2E_FAIL_ON_ERROR=${E2E_FAIL_ON_ERROR}"
# Only run on linux/amd64 to avoid running multiple times (once per build)
# and to ensure we can run the binary on the current host (assuming host is amd64).
if [ -n "${GOARCH:-}" ] && [ "${GOARCH}" != "amd64" ]; then
log "Skipping smoke tests for non-amd64 build (GOARCH=${GOARCH})."
exit 0
fi
if ! is_true "${RUN_E2E}"; then
log "RUN_E2E is not enabled. Skipping smoke tests. (RUN_E2E=${RUN_E2E})"
exit 0
fi
# Locate the amd64 artifact in dist/.
# Goreleaser v2 puts binaries in dist/<id>_<os>_<arch>_<version>/<binary>
# Example: dist/cli_linux_amd64_v1/kubescape
ART_PATH=""
if [ -d "$REPO_ROOT/dist" ]; then
# Find any file named 'kubescape' inside a directory containing 'linux_amd64' inside 'dist'
# We use 'find' for robustness against varying directory names
ART_PATH=$(find "$REPO_ROOT/dist" -type f -name "kubescape" -path "*linux_amd64*" | head -n 1)
fi
if [ -z "$ART_PATH" ] || [ ! -f "$ART_PATH" ]; then
log "No kubescape artifact found in dist/ matching *linux_amd64*/kubescape. Skipping smoke tests."
# If we are supposed to run E2E, not finding the artifact is probably an error.
if is_true "${E2E_FAIL_ON_ERROR}"; then
log "E2E_FAIL_ON_ERROR enabled -> failing because artifact was not found."
exit 1
fi
exit 0
fi
log "Using artifact: $ART_PATH"
# Make binary executable if it is a binary
chmod +x "$ART_PATH" >/dev/null 2>&1 || true
# Locate python runner
PYTHON=""
if command -v python3 >/dev/null 2>&1; then
PYTHON=python3
elif command -v python >/dev/null 2>&1; then
PYTHON=python
fi
if [ -z "$PYTHON" ]; then
log "python3 (or python) not found in PATH."
if is_true "${E2E_FAIL_ON_ERROR}"; then
log "E2E_FAIL_ON_ERROR enabled -> failing the release because python is missing."
exit 2
else
log "E2E_FAIL_ON_ERROR disabled -> continuing without running tests."
exit 0
fi
fi
# Check for smoke test runner
SMOKE_RUNNER="$REPO_ROOT/smoke_testing/init.py"
if [ ! -f "$SMOKE_RUNNER" ]; then
log "Smoke test runner not found at $SMOKE_RUNNER"
if is_true "${E2E_FAIL_ON_ERROR}"; then
log "E2E_FAIL_ON_ERROR enabled -> failing the release because smoke runner is missing."
exit 3
else
log "E2E_FAIL_ON_ERROR disabled -> continuing without running tests."
exit 0
fi
fi
gha_group_start "Smoke tests"
log "Running smoke tests with $PYTHON $SMOKE_RUNNER \"$ART_PATH\""
# Run the test runner, propagate exit code
set +e
RELEASE="${RELEASE:-}" "$PYTHON" "$SMOKE_RUNNER" "$ART_PATH"
rc=$?
set -e
if [ $rc -eq 0 ]; then
log "Smoke tests passed (exit code 0)."
fi
log "Smoke tests exited with code: $rc"
gha_group_end
if [ $rc -ne 0 ]; then
if is_true "${E2E_FAIL_ON_ERROR}"; then
log "E2E_FAIL_ON_ERROR enabled -> failing the release (exit code $rc)."
exit $rc
else
log "E2E_FAIL_ON_ERROR disabled -> continuing despite test failures."
fi
fi
exit 0

View File

@@ -0,0 +1,13 @@
FROM gcr.io/distroless/static-debian13:debug-nonroot
USER nonroot
WORKDIR /home/nonroot/
ARG image_version client TARGETARCH
ENV RELEASE=$image_version CLIENT=$client
ARG TARGETPLATFORM
COPY $TARGETPLATFORM/kubescape /usr/bin/kubescape
RUN ["kubescape", "download", "artifacts"]
ENTRYPOINT ["kubescape"]

View File

@@ -0,0 +1 @@
.git

View File

@@ -1,101 +0,0 @@
package apis
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
// HTTPReqFunc allows you to insert query params and more to aggregation message while using update aggregator
type HTTPReqFunc func(req *http.Request, qryData interface{})
func BasicBEQuery(req *http.Request, qryData interface{}) {
q := req.URL.Query()
if notificationData, isok := qryData.(*LoginObject); isok {
q.Add("customerGUID", notificationData.GUID)
}
req.URL.RawQuery = q.Encode()
}
func EmptyQuery(req *http.Request, qryData interface{}) {
q := req.URL.Query()
req.URL.RawQuery = q.Encode()
}
func MapQuery(req *http.Request, qryData interface{}) {
q := req.URL.Query()
if qryMap, isok := qryData.(map[string]string); isok {
for k, v := range qryMap {
q.Add(k, v)
}
}
req.URL.RawQuery = q.Encode()
}
func BEHttpRequest(loginobj *LoginObject, beURL,
httpverb string,
endpoint string,
payload []byte,
f HTTPReqFunc,
qryData interface{}) ([]byte, error) {
client := &http.Client{}
beURL = fmt.Sprintf("%v/%v", beURL, endpoint)
req, err := http.NewRequest(httpverb, beURL, bytes.NewReader(payload))
if err != nil {
return nil, err
}
req.Header.Set("Authorization", loginobj.Authorization)
f(req, qryData)
for _, cookie := range loginobj.Cookies {
req.AddCookie(cookie)
}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
fmt.Printf("req:\n%v\nresp:%v\n", req, resp)
return nil, fmt.Errorf("Error #%v Due to: %v", resp.StatusCode, resp.Status)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
return body, nil
}
type BELoginResponse struct {
Name string `json:"name"`
PreferredUsername string `json:"preferred_username"`
Email string `json:"email"`
CustomerGuid string `json:"customerGuid"`
Expires string `json:"expires"`
Authorization string `json:"authorization"`
Cookies []*http.Cookie
}
func (r *BELoginResponse) ToLoginObject() *LoginObject {
l := &LoginObject{}
l.Authorization = r.Authorization
l.Cookies = r.Cookies
l.Expires = r.Expires
l.GUID = r.CustomerGuid
return l
}
type BackendConnector struct {
BaseURL string
BELoginResponse *BELoginResponse
Credentials *CustomerLoginDetails
HTTPClient *http.Client
}

View File

@@ -1,128 +0,0 @@
package apis
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func MakeBackendConnector(client *http.Client, baseURL string, loginDetails *CustomerLoginDetails) (*BackendConnector, error) {
if err := ValidateBEConnectorMakerInput(client, baseURL, loginDetails); err != nil {
return nil, err
}
conn := &BackendConnector{BaseURL: baseURL, Credentials: loginDetails, HTTPClient: client}
err := conn.Login()
return conn, err
}
func ValidateBEConnectorMakerInput(client *http.Client, baseURL string, loginDetails *CustomerLoginDetails) error {
if client == nil {
fmt.Errorf("You must provide an initialized httpclient")
}
if len(baseURL) == 0 {
return fmt.Errorf("you must provide a valid backend url")
}
if loginDetails == nil || (len(loginDetails.Email) == 0 && len(loginDetails.Password) == 0) {
return fmt.Errorf("you must provide valid login details")
}
return nil
}
func (r *BackendConnector) Login() error {
if !r.IsExpired() {
return nil
}
loginInfoBytes, err := json.Marshal(r.Credentials)
if err != nil {
return fmt.Errorf("unable to marshal credentials properly")
}
beURL := fmt.Sprintf("%v/%v", r.BaseURL, "login")
req, err := http.NewRequest("POST", beURL, bytes.NewReader(loginInfoBytes))
if err != nil {
return err
}
req.Header.Set("Referer", strings.Replace(beURL, "dashbe", "cpanel", 1))
resp, err := r.HTTPClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("unable to read login response")
}
loginS := &BELoginResponse{}
json.Unmarshal(body, &loginS)
loginS.Cookies = resp.Cookies()
r.BELoginResponse = loginS
return nil
}
func (r *BackendConnector) IsExpired() bool {
return r.BELoginResponse == nil || r.BELoginResponse.ToLoginObject().IsExpired()
}
func (r *BackendConnector) GetBaseURL() string {
return r.BaseURL
}
func (r *BackendConnector) GetLoginObj() *LoginObject {
return r.BELoginResponse.ToLoginObject()
}
func (r *BackendConnector) GetClient() *http.Client {
return r.HTTPClient
}
func (r *BackendConnector) HTTPSend(httpverb string,
endpoint string,
payload []byte,
f HTTPReqFunc,
qryData interface{}) ([]byte, error) {
beURL := fmt.Sprintf("%v/%v", r.GetBaseURL(), endpoint)
req, err := http.NewRequest(httpverb, beURL, bytes.NewReader(payload))
if err != nil {
return nil, err
}
if r.IsExpired() {
r.Login()
}
loginobj := r.GetLoginObj()
req.Header.Set("Authorization", loginobj.Authorization)
f(req, qryData)
q := req.URL.Query()
q.Set("customerGUID", loginobj.GUID)
req.URL.RawQuery = q.Encode()
for _, cookie := range loginobj.Cookies {
req.AddCookie(cookie)
}
resp, err := r.GetClient().Do(req)
if err != nil {
return nil, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
fmt.Printf("req:\n%v\nresp:%v\n", req, resp)
return nil, fmt.Errorf("Error #%v Due to: %v", resp.StatusCode, resp.Status)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
return body, nil
}

View File

@@ -1,25 +0,0 @@
package apis
// WebsocketScanCommand api
const (
WebsocketScanCommandVersion string = "v1"
WebsocketScanCommandPath string = "scanImage"
)
// commands send via websocket
const (
UPDATE string = "update"
ATTACH string = "Attach"
REMOVE string = "remove"
DETACH string = "Detach"
INCOMPATIBLE string = "Incompatible"
REPLACE_HEADERS string = "ReplaceHeaders"
IMAGE_UNREACHABLE string = "ImageUnreachable"
SIGN string = "sign"
UNREGISTERED string = "unregistered"
INJECT string = "inject"
RESTART string = "restart"
ENCRYPT string = "encryptSecret"
DECRYPT string = "decryptSecret"
SCAN string = "scan"
)

View File

@@ -1,78 +0,0 @@
package apis
import (
"encoding/json"
"fmt"
"net/http"
"github.com/docker/docker/api/types"
)
// WebsocketScanCommand trigger scan thru the websocket
type WebsocketScanCommand struct {
// CustomerGUID string `json:"customerGUID"`
ImageTag string `json:"imageTag"`
Wlid string `json:"wlid"`
IsScanned bool `json:"isScanned"`
ContainerName string `json:"containerName"`
JobID string `json:"jobID,omitempty"`
LastAction int `json:"actionIDN"`
// ImageHash string `json:"imageHash"`
Credentials *types.AuthConfig `json:"credentials,omitempty"`
}
//taken from BE
// ElasticRespTotal holds the total struct in Elastic array response
type ElasticRespTotal struct {
Value int `json:"value"`
Relation string `json:"relation"`
}
// V2ListResponse holds the response of some list request with some metadata
type V2ListResponse struct {
Total ElasticRespTotal `json:"total"`
Response interface{} `json:"response"`
// Cursor for quick access to the next page. Not supported yet
Cursor string `json:"cursor"`
}
// Oauth2Customer returns inside the "ca_groups" field in claims section of
// Oauth2 verification process
type Oauth2Customer struct {
CustomerName string `json:"customerName"`
CustomerGUID string `json:"customerGUID"`
}
type LoginObject struct {
Authorization string `json:"authorization"`
GUID string
Cookies []*http.Cookie
Expires string
}
type SafeMode struct {
Reporter string `json:"reporter"` // "Agent"
Action string `json:"action,omitempty"` // "action"
Wlid string `json:"wlid"` // CAA_WLID
PodName string `json:"podName"` // CAA_POD_NAME
InstanceID string `json:"instanceID"` // CAA_POD_NAME
ContainerName string `json:"containerName,omitempty"` // CAA_CONTAINER_NAME
ProcessName string `json:"processName,omitempty"`
ProcessID int `json:"processID,omitempty"`
ProcessCMD string `json:"processCMD,omitempty"`
ComponentGUID string `json:"componentGUID,omitempty"` // CAA_GUID
StatusCode int `json:"statusCode"` // 0/1/2
ProcessExitCode int `json:"processExitCode"` // 0 +
Timestamp int64 `json:"timestamp"`
Message string `json:"message,omitempty"` // any string
JobID string `json:"jobID,omitempty"` // any string
Compatible *bool `json:"compatible,omitempty"`
}
func (safeMode *SafeMode) Json() string {
b, err := json.Marshal(*safeMode)
if err != nil {
return ""
}
return fmt.Sprintf("%s", b)
}

View File

@@ -1,26 +0,0 @@
package apis
// import (
// "fmt"
// "net/http"
// "testing"
// )
// func TestAuditStructure(t *testing.T) {
// c := http.Client{}
// be, err := MakeBackendConnector(&c, "https://dashbe.eudev3.cyberarmorsoft.com", &CustomerLoginDetails{Email: "lalafi@cyberarmor.io", Password: "*", CustomerName: "CyberArmorTests"})
// if err != nil {
// t.Errorf("sad1")
// }
// b, err := be.HTTPSend("GET", "v1/microservicesOverview", nil, MapQuery, map[string]string{"wlid": "wlid://cluster-childrenofbodom/namespace-default/deployment-pos"})
// if err != nil {
// t.Errorf("sad2")
// }
// fmt.Printf("%v", string(b))
// t.Errorf("sad")
// }

View File

@@ -1,27 +0,0 @@
package apis
import (
"net/http"
)
// type Dashboard interface {
// OPAFRAMEWORKGet(string, bool) ([]opapolicy.Framework, error)
// }
// Connector - interface for any connector (BE/Portal and so on)
type Connector interface {
//may used for a more generic httpsend interface based method
GetBaseURL() string
GetLoginObj() *LoginObject
GetClient() *http.Client
Login() error
IsExpired() bool
HTTPSend(httpverb string,
endpoint string,
payload []byte,
f HTTPReqFunc,
qryData interface{}) ([]byte, error)
}

View File

@@ -1,256 +0,0 @@
package apis
import (
"bytes"
"net/http"
"time"
"io/ioutil"
oidc "github.com/coreos/go-oidc"
uuid "github.com/satori/go.uuid"
// "go.uber.org/zap"
"context"
"encoding/json"
"fmt"
"strings"
"golang.org/x/oauth2"
)
func GetOauth2TokenURL() string {
return "https://idens.eudev3.cyberarmorsoft.com/auth/realms/CyberArmorSites"
}
func GetLoginStruct() (LoginAux, error) {
return LoginAux{Referer: "https://cpanel.eudev3.cyberarmorsoft.com/login", Url: "https://cpanel.eudev3.cyberarmorsoft.com/login"}, nil
}
func LoginWithKeycloak(loginDetails CustomerLoginDetails) ([]uuid.UUID, *oidc.IDToken, error) {
// var custGUID uuid.UUID
// config.Oauth2TokenURL
if GetOauth2TokenURL() == "" {
return nil, nil, fmt.Errorf("missing oauth2 token URL")
}
urlaux, _ := GetLoginStruct()
conf, err := getOauth2Config(urlaux)
if err != nil {
return nil, nil, err
}
ctx := context.Background()
provider, err := oidc.NewProvider(ctx, GetOauth2TokenURL())
if err != nil {
return nil, nil, err
}
// "Oauth2ClientID": "golang-client"
oidcConfig := &oidc.Config{
ClientID: "golang-client",
SkipClientIDCheck: true,
}
verifier := provider.Verifier(oidcConfig)
ouToken, err := conf.PasswordCredentialsToken(ctx, loginDetails.Email, loginDetails.Password)
if err != nil {
return nil, nil, err
}
// "Authorization",
authorization := fmt.Sprintf("%s %s", ouToken.Type(), ouToken.AccessToken)
// oidc.IDTokenVerifier
tkn, err := verifier.Verify(ctx, ouToken.AccessToken)
if err != nil {
return nil, tkn, err
}
tkn.Nonce = authorization
if loginDetails.CustomerName == "" {
customers, err := getCustomersNames(tkn)
if err != nil {
return nil, tkn, err
}
if len(customers) == 1 {
loginDetails.CustomerName = customers[0]
} else {
return nil, tkn, fmt.Errorf("login with one of the following customers: %v", customers)
}
}
custGUID, err := getCustomerGUID(tkn, &loginDetails)
if err != nil {
return nil, tkn, err
}
return []uuid.UUID{custGUID}, tkn, nil
}
func getOauth2Config(urlaux LoginAux) (*oauth2.Config, error) {
reURLSlices := strings.Split(urlaux.Referer, "/")
if len(reURLSlices) == 0 {
reURLSlices = strings.Split(urlaux.Url, "/")
}
// zapLogger.With(zap.Strings("referer", reURLSlices)).Info("Searching oauth2Config for")
if len(reURLSlices) < 3 {
reURLSlices = []string{reURLSlices[0], reURLSlices[0], reURLSlices[0]}
}
lg, _ := GetLoginStruct()
provider, _ := oidc.NewProvider(context.Background(), GetOauth2TokenURL())
//provider.Endpoint {"AuthURL":"https://idens.eudev3.cyberarmorsoft.com/auth/realms/CyberArmorSites/protocol/openid-connect/auth","TokenURL":"https://idens.eudev3.cyberarmorsoft.com/auth/realms/CyberArmorSites/protocol/openid-connect/token","AuthStyle":0}
conf := oauth2.Config{
ClientID: "golang-client",
ClientSecret: "4e33bad2-3491-41a6-b486-93c492cfb4a2",
RedirectURL: lg.Referer,
// Discovery returns the OAuth2 endpoints.
Endpoint: provider.Endpoint(),
// "openid" is a required scope for OpenID Connect flows.
Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
}
return &conf, nil
// return nil, fmt.Errorf("canno't find oauth2Config for referer '%+v'.\nPlease set referer or origin headers", reURLSlices)
}
func getCustomersNames(oauth2Details *oidc.IDToken) ([]string, error) {
var claimsJSON Oauth2Claims
if err := oauth2Details.Claims(&claimsJSON); err != nil {
return nil, err
}
customersList := make([]string, 0, len(claimsJSON.CAGroups))
for _, v := range claimsJSON.CAGroups {
var caCustomer Oauth2Customer
if err := json.Unmarshal([]byte(v), &caCustomer); err == nil {
customersList = append(customersList, caCustomer.CustomerName)
}
}
return customersList, nil
}
func getCustomerGUID(tkn *oidc.IDToken, loginDetails *CustomerLoginDetails) (uuid.UUID, error) {
customers, err := getCustomersList(tkn)
if err != nil {
return uuid.UUID{}, err
}
// if customer name not provided - use default customer
if loginDetails.CustomerName == "" && len(customers) > 0 {
return uuid.FromString(customers[0].CustomerGUID)
}
for _, i := range customers {
if i.CustomerName == loginDetails.CustomerName {
return uuid.FromString(i.CustomerGUID)
}
}
return uuid.UUID{}, fmt.Errorf("customer name not found in customer list")
}
func getCustomersList(oauth2Details *oidc.IDToken) ([]Oauth2Customer, error) {
var claimsJSON Oauth2Claims
if err := oauth2Details.Claims(&claimsJSON); err != nil {
return nil, err
}
customersList := make([]Oauth2Customer, 0, len(claimsJSON.CAGroups))
for _, v := range claimsJSON.CAGroups {
var caCustomer Oauth2Customer
if err := json.Unmarshal([]byte(v), &caCustomer); err == nil {
customersList = append(customersList, caCustomer)
}
}
return customersList, nil
}
// func MakeAuthCookies(custGUID uuid.UUID, ouToken *oidc.IDToken) (*http.Cookie, error) {
// var ccc http.Cookie
// var responseData AuthenticationCookie
// expireDate := time.Now().UTC().Add(time.Duration(config.CookieExpirationHours) * time.Hour)
// if ouToken != nil {
// expireDate = ouToken.Expiry
// }
// ccc.Expires = expireDate
// responseData.CustomerGUID = custGUID
// responseData.Expires = ccc.Expires
// responseData.Version = 0
// authorizationStr := ""
// if ouToken != nil {
// authorizationStr = ouToken.Nonce
// if err := ouToken.Claims(&responseData.Oauth2Claims); err != nil {
// errStr := fmt.Sprintf("failed to get claims from JWT")
// return nil, fmt.Errorf("%v", errStr)
// }
// }
// jsonBytes, err := json.Marshal(responseData)
// if err != nil {
// errStr := fmt.Sprintf("failed to get claims from JWT")
// return nil, fmt.Errorf("%v", errStr)
// }
// ccc.Name = "auth"
// ccc.Value = hex.EncodeToString(jsonBytes) + "." + cacheaccess.CalcHmac256(jsonBytes)
// // TODO: HttpOnly for security...
// ccc.HttpOnly = false
// ccc.Path = "/"
// ccc.Secure = true
// ccc.SameSite = http.SameSiteNoneMode
// http.SetCookie(w, &ccc)
// responseData.Authorization = authorizationStr
// jsonBytes, err = json.Marshal(responseData)
// if err != nil {
// w.WriteHeader(http.StatusInternalServerError)
// fmt.Fprintf(w, "error while marshaling response(2) %s", err)
// return
// }
// w.Write(jsonBytes)
// }
func Login(loginDetails CustomerLoginDetails) (*LoginObject, error) {
return nil, nil
}
func GetBEInfo(cfgFile string) string {
return "https://dashbe.eudev3.cyberarmorsoft.com"
}
func BELogin(loginDetails *CustomerLoginDetails, login string, cfg string) (*BELoginResponse, error) {
client := &http.Client{}
basebeURL := GetBEInfo(cfg)
beURL := fmt.Sprintf("%v/%v", basebeURL, login)
loginInfoBytes, err := json.Marshal(loginDetails)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", beURL, bytes.NewReader(loginInfoBytes))
if err != nil {
return nil, err
}
req.Header.Set("Referer", strings.Replace(beURL, "dashbe", "cpanel", 1))
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
loginS := &BELoginResponse{}
json.Unmarshal(body, &loginS)
loginS.Cookies = resp.Cookies()
return loginS, nil
}
func (r *LoginObject) IsExpired() bool {
if r == nil {
return true
}
t, err := time.Parse(time.RFC3339, r.Expires)
if err != nil {
return true
}
return t.UTC().Before(time.Now().UTC())
}

View File

@@ -1,41 +0,0 @@
package apis
// func TestLogin2BE(t *testing.T) {
// loginDetails := CustomerLoginDetails{Email: "lalafi@cyberarmor.io", Password: "***", CustomerName: "CyberArmorTests"}
// res, err := BELogin(loginDetails, "login")
// if err != nil {
// t.Errorf("failed to get raw audit is different ")
// }
// k := res.ToLoginObject()
// fmt.Printf("%v\n", k)
// }
// func TestGetMicroserviceOverview(t *testing.T) {
// // client := &http.Client{}
// loginDetails := CustomerLoginDetails{Email: "lalafi@cyberarmor.io", Password: "***", CustomerName: "CyberArmorTests"}
// loginobj, err := BELogin(loginDetails, "login")
// if err != nil {
// t.Errorf("failed to get raw audit is different ")
// }
// k := loginobj.ToLoginObject()
// beURL := GetBEInfo("")
// res, err := BEHttpRequest(k, beURL,
// "GET",
// "v1/microservicesOverview",
// nil,
// BasicBEQuery,
// k)
// if err != nil {
// t.Errorf("failed to get raw audit is different ")
// }
// s := string(res)
// fmt.Printf("%v\n", s)
// }

View File

@@ -1,38 +0,0 @@
package apis
import (
"time"
"github.com/gofrs/uuid"
)
// AuthenticationCookie is what it is
type AuthenticationCookie struct {
Oauth2Claims `json:",inline"`
CustomerGUID uuid.UUID `json:"customerGuid"`
Expires time.Time `json:"expires"`
Version int `json:"version"`
Authorization string `json:"authorization,omitempty"`
}
type LoginAux struct {
Referer string
Url string
}
// CustomerLoginDetails is what it is
type CustomerLoginDetails struct {
Email string `json:"email"`
Password string `json:"password"`
CustomerName string `json:"customer,omitempty"`
CustomerGUID uuid.UUID `json:"customerGuid,omitempty"`
}
// Oauth2Claims returns in claims section of Oauth2 verification process
type Oauth2Claims struct {
Sub string `json:"sub"`
Name string `json:"name"`
PreferredUserName string `json:"preferred_username"`
CAGroups []string `json:"ca_groups"`
Email string `json:"email"`
}

View File

@@ -1,132 +0,0 @@
package apis
import (
"encoding/json"
"fmt"
)
// Commands list of commands received from websocket
type Commands struct {
Commands []Command `json:"commands"`
}
// Command structure of command received from websocket
type Command struct {
CommandName string `json:"commandName"`
ResponseID string `json:"responseID"`
Wlid string `json:"wlid,omitempty"`
WildWlid string `json:"wildWlid,omitempty"`
Sid string `json:"sid,omitempty"`
WildSid string `json:"wildSid,omitempty"`
JobTracking JobTracking `json:"jobTracking"`
Args map[string]interface{} `json:"args,omitempty"`
}
type JobTracking struct {
JobID string `json:"jobID,omitempty"`
ParentID string `json:"parentAction,omitempty"`
LastActionNumber int `json:"numSeq,omitempty"`
}
func (c *Command) DeepCopy() *Command {
newCommand := &Command{}
newCommand.CommandName = c.CommandName
newCommand.ResponseID = c.ResponseID
newCommand.Wlid = c.Wlid
newCommand.WildWlid = c.WildWlid
if c.Args != nil {
newCommand.Args = make(map[string]interface{})
for i, j := range c.Args {
newCommand.Args[i] = j
}
}
return newCommand
}
func (c *Command) GetLabels() map[string]string {
if c.Args != nil {
if ilabels, ok := c.Args["labels"]; ok {
labels := map[string]string{}
if b, e := json.Marshal(ilabels); e == nil {
if e = json.Unmarshal(b, &labels); e == nil {
return labels
}
}
}
}
return map[string]string{}
}
func (c *Command) SetLabels(labels map[string]string) {
if c.Args == nil {
c.Args = make(map[string]interface{})
}
c.Args["labels"] = labels
}
func (c *Command) GetFieldSelector() map[string]string {
if c.Args != nil {
if ilabels, ok := c.Args["fieldSelector"]; ok {
labels := map[string]string{}
if b, e := json.Marshal(ilabels); e == nil {
if e = json.Unmarshal(b, &labels); e == nil {
return labels
}
}
}
}
return map[string]string{}
}
func (c *Command) SetFieldSelector(labels map[string]string) {
if c.Args == nil {
c.Args = make(map[string]interface{})
}
c.Args["fieldSelector"] = labels
}
func (c *Command) GetID() string {
if c.WildWlid != "" {
return c.WildWlid
}
if c.WildSid != "" {
return c.WildSid
}
if c.Wlid != "" {
return c.Wlid
}
if c.Sid != "" {
return c.Sid
}
return ""
}
func (c *Command) Json() string {
b, _ := json.Marshal(*c)
return fmt.Sprintf("%s", b)
}
func SIDFallback(c *Command) {
if c.GetID() == "" {
sid, err := getSIDFromArgs(c.Args)
if err != nil || sid == "" {
return
}
c.Sid = sid
}
}
func getSIDFromArgs(args map[string]interface{}) (string, error) {
sidInterface, ok := args["sid"]
if !ok {
return "", nil
}
sid, ok := sidInterface.(string)
if !ok || sid == "" {
return "", fmt.Errorf("sid found in args but empty")
}
// if _, err := secrethandling.SplitSecretID(sid); err != nil {
// return "", err
// }
return sid, nil
}

View File

@@ -1,16 +0,0 @@
package armotypes
type EnforcmentsRule struct {
MonitoredObject []string `json:"monitoredObject"`
MonitoredObjectExistence []string `json:"objectExistence"`
MonitoredObjectEvent []string `json:"event"`
Action []string `json:"action"`
}
type ExecutionPolicy struct {
PortalBase `json:",inline"`
Designators []PortalDesignator `json:"designators"`
PolicyType string `json:"policyType"`
CreationTime string `json:"creation_time"`
ExecutionEnforcmentsRules []EnforcmentsRule `json:"enforcementRules"`
}

View File

@@ -1,57 +0,0 @@
package armotypes
const (
CostumerGuidQuery = "costumerGUID"
ClusterNameQuery = "cluster"
DatacenterNameQuery = "datacenter"
NamespaceQuery = "namespace"
ProjectQuery = "project"
WlidQuery = "wlid"
SidQuery = "sid"
)
// PortalBase holds basic items data from portal BE
type PortalBase struct {
GUID string `json:"guid"`
Name string `json:"name"`
Attributes map[string]interface{} `json:"attributes,omitempty"` // could be string
}
type DesignatorType string
// Supported designators
const (
DesignatorAttributes DesignatorType = "Attributes"
/*
WorkloadID format.
k8s format: wlid://cluster-<cluster>/namespace-<namespace>/<kind>-<name>
native format: wlid://datacenter-<datacenter>/project-<project>/native-<name>
*/
DesignatorWlid DesignatorType = "Wlid"
/*
Wild card - subset of wlid. e.g.
1. Include cluster:
wlid://cluster-<cluster>/
2. Include cluster and namespace (filter out all other namespaces):
wlid://cluster-<cluster>/namespace-<namespace>/
*/
DesignatorWildWlid DesignatorType = "WildWlid"
DesignatorWlidContainer DesignatorType = "WlidContainer"
DesignatorWlidProcess DesignatorType = "WlidProcess"
DesignatorSid DesignatorType = "Sid" // secret id
)
// attributes
const (
AttributeCluster = "cluster"
AttributeNamespace = "namespace"
)
// PortalDesignator represented single designation options
type PortalDesignator struct {
DesignatorType DesignatorType `json:"designatorType"`
WLID string `json:"wlid"`
WildWLID string `json:"wildwlid"`
SID string `json:"sid"`
Attributes map[string]string `json:"attributes"`
}

View File

@@ -1,18 +0,0 @@
package armotypes
func MockPortalBase(customerGUID, name string, attributes map[string]interface{}) *PortalBase {
if customerGUID == "" {
customerGUID = "36b6f9e1-3b63-4628-994d-cbe16f81e9c7"
}
if name == "" {
name = "portalbase-a"
}
if attributes == nil {
attributes = make(map[string]interface{})
}
return &PortalBase{
GUID: customerGUID,
Name: name,
Attributes: attributes,
}
}

View File

@@ -1,39 +0,0 @@
package armotypes
import "github.com/golang/glog"
var IgnoreLabels = []string{AttributeCluster, AttributeNamespace}
// DigestPortalDesignator - get cluster namespace and labels from designator
func DigestPortalDesignator(designator *PortalDesignator) (string, string, map[string]string) {
switch designator.DesignatorType {
case DesignatorAttributes:
return DigestAttributesDesignator(designator.Attributes)
// case DesignatorWlid: TODO
// case DesignatorWildWlid: TODO
default:
glog.Warningf("in 'digestPortalDesignator' designator type: '%v' not yet supported. please contact Armo team", designator.DesignatorType)
}
return "", "", nil
}
func DigestAttributesDesignator(attributes map[string]string) (string, string, map[string]string) {
cluster := ""
namespace := ""
labels := map[string]string{}
if attributes == nil || len(attributes) == 0 {
return cluster, namespace, labels
}
for k, v := range attributes {
labels[k] = v
}
if v, ok := attributes[AttributeNamespace]; ok {
namespace = v
delete(labels, AttributeNamespace)
}
if v, ok := attributes[AttributeCluster]; ok {
cluster = v
delete(labels, AttributeCluster)
}
return cluster, namespace, labels
}

View File

@@ -1,197 +0,0 @@
package cautils
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/golang/glog"
)
// labels added to the workload
const (
ArmoPrefix string = "armo"
ArmoAttach string = ArmoPrefix + ".attach"
ArmoInitialSecret string = ArmoPrefix + ".initial"
ArmoSecretStatus string = ArmoPrefix + ".secret"
ArmoCompatibleLabel string = ArmoPrefix + ".compatible"
ArmoSecretProtectStatus string = "protect"
ArmoSecretClearStatus string = "clear"
)
// annotations added to the workload
const (
ArmoUpdate string = ArmoPrefix + ".last-update"
ArmoWlid string = ArmoPrefix + ".wlid"
ArmoSid string = ArmoPrefix + ".sid"
ArmoJobID string = ArmoPrefix + ".job"
ArmoJobIDPath string = ArmoJobID + "/id"
ArmoJobParentPath string = ArmoJobID + "/parent"
ArmoJobActionPath string = ArmoJobID + "/action"
ArmoCompatibleAnnotation string = ArmoAttach + "/compatible"
ArmoReplaceheaders string = ArmoAttach + "/replaceheaders"
)
const ( // DEPRECATED
CAAttachLabel string = "cyberarmor"
Patched string = "Patched"
Done string = "Done"
Encrypted string = "Protected"
CAInjectOld = "injectCyberArmor"
CAPrefix string = "cyberarmor"
CAProtectedSecret string = CAPrefix + ".secret"
CAInitialSecret string = CAPrefix + ".initial"
CAInject string = CAPrefix + ".inject"
CAIgnore string = CAPrefix + ".ignore"
CAReplaceHeaders string = CAPrefix + ".removeSecurityHeaders"
)
const ( // DEPRECATED
CAUpdate string = CAPrefix + ".last-update"
CAStatus string = CAPrefix + ".status"
CAWlid string = CAPrefix + ".wlid"
)
type ClusterConfig struct {
EventReceiverREST string `json:"eventReceiverREST"`
EventReceiverWS string `json:"eventReceiverWS"`
MaserNotificationServer string `json:"maserNotificationServer"`
Postman string `json:"postman"`
Dashboard string `json:"dashboard"`
Portal string `json:"portal"`
CustomerGUID string `json:"customerGUID"`
ClusterGUID string `json:"clusterGUID"`
ClusterName string `json:"clusterName"`
OciImageURL string `json:"ociImageURL"`
NotificationWSURL string `json:"notificationWSURL"`
NotificationRestURL string `json:"notificationRestURL"`
VulnScanURL string `json:"vulnScanURL"`
OracleURL string `json:"oracleURL"`
ClairURL string `json:"clairURL"`
}
// represents workload basic info
type SpiffeBasicInfo struct {
//cluster/datacenter
Level0 string `json:"level0"`
Level0Type string `json:"level0Type"`
//namespace/project
Level1 string `json:"level0"`
Level1Type string `json:"level0Type"`
Kind string `json:"kind"`
Name string `json:"name"`
}
type ImageInfo struct {
Registry string `json:"registry"`
VersionImage string `json:"versionImage"`
}
func IsAttached(labels map[string]string) *bool {
attach := false
if labels == nil {
return nil
}
if attached, ok := labels[ArmoAttach]; ok {
if strings.ToLower(attached) == "true" {
attach = true
return &attach
} else {
return &attach
}
}
// deprecated
if _, ok := labels[CAAttachLabel]; ok {
attach = true
return &attach
}
// deprecated
if inject, ok := labels[CAInject]; ok {
if strings.ToLower(inject) == "true" {
attach = true
return &attach
}
}
// deprecated
if ignore, ok := labels[CAIgnore]; ok {
if strings.ToLower(ignore) == "true" {
return &attach
}
}
return nil
}
func IsSecretProtected(labels map[string]string) *bool {
protect := false
if labels == nil {
return nil
}
if protected, ok := labels[ArmoSecretStatus]; ok {
if strings.ToLower(protected) == ArmoSecretProtectStatus {
protect = true
return &protect
} else {
return &protect
}
}
return nil
}
func LoadConfig(configPath string, loadToEnv bool) (*ClusterConfig, error) {
if configPath == "" {
configPath = "/etc/config/clusterData.json"
}
dat, err := ioutil.ReadFile(configPath)
if err != nil || len(dat) == 0 {
return nil, fmt.Errorf("Config empty or not found. path: %s", configPath)
}
componentConfig := &ClusterConfig{}
if err := json.Unmarshal(dat, componentConfig); err != nil {
return componentConfig, fmt.Errorf("Failed to read component config, path: %s, reason: %s", configPath, err.Error())
}
if loadToEnv {
componentConfig.LoadConfigToEnv()
}
return componentConfig, nil
}
func (clusterConfig *ClusterConfig) LoadConfigToEnv() {
SetEnv("CA_CLUSTER_NAME", clusterConfig.ClusterName)
SetEnv("CA_CLUSTER_GUID", clusterConfig.ClusterGUID)
SetEnv("CA_ORACLE_SERVER", clusterConfig.OracleURL)
SetEnv("CA_CUSTOMER_GUID", clusterConfig.CustomerGUID)
SetEnv("CA_DASHBOARD_BACKEND", clusterConfig.Dashboard)
SetEnv("CA_NOTIFICATION_SERVER_REST", clusterConfig.NotificationWSURL)
SetEnv("CA_NOTIFICATION_SERVER_WS", clusterConfig.NotificationWSURL)
SetEnv("CA_NOTIFICATION_SERVER_REST", clusterConfig.NotificationRestURL)
SetEnv("CA_OCIMAGE_URL", clusterConfig.OciImageURL)
SetEnv("CA_K8S_REPORT_URL", clusterConfig.EventReceiverWS)
SetEnv("CA_EVENT_RECEIVER_HTTP", clusterConfig.EventReceiverREST)
SetEnv("CA_VULNSCAN", clusterConfig.VulnScanURL)
SetEnv("CA_POSTMAN", clusterConfig.Postman)
SetEnv("MASTER_NOTIFICATION_SERVER_HOST", clusterConfig.MaserNotificationServer)
SetEnv("CLAIR_URL", clusterConfig.ClairURL)
}
func SetEnv(key, value string) {
if e := os.Getenv(key); e == "" {
if err := os.Setenv(key, value); err != nil {
glog.Warning("%s: %s", key, err.Error())
}
}
}

View File

@@ -1,29 +0,0 @@
package cautils
import (
"testing"
)
// tests wlid parse
func TestSpiffeWLIDToInfoSuccess(t *testing.T) {
WLID := "wlid://cluster-HipsterShopCluster2/namespace-prod/deployment-cartservice"
ms, er := SpiffeToSpiffeInfo(WLID)
if er != nil || ms.Level0 != "HipsterShopCluster2" || ms.Level0Type != "cluster" || ms.Level1 != "prod" || ms.Level1Type != "namespace" ||
ms.Kind != "deployment" || ms.Name != "cartservice" {
t.Errorf("TestSpiffeWLIDToInfoSuccess failed to parse %v", WLID)
}
}
func TestSpiffeSIDInfoSuccess(t *testing.T) {
SID := "sid://cluster-HipsterShopCluster2/namespace-dev/secret-caregcred"
ms, er := SpiffeToSpiffeInfo(SID)
if er != nil || ms.Level0 != "HipsterShopCluster2" || ms.Level0Type != "cluster" || ms.Level1 != "dev" || ms.Level1Type != "namespace" ||
ms.Kind != "secret" || ms.Name != "caregcred" {
t.Errorf("TestSpiffeSIDInfoSuccess failed to parse %v", SID)
}
}

View File

@@ -1,118 +0,0 @@
package cautils
import (
"crypto/sha256"
"fmt"
"strings"
)
// wlid/ sid utils
const (
SpiffePrefix = "://"
)
// wlid/ sid utils
const (
PackagePath = "vendor/github.com/armosec/capacketsgo"
)
//AsSHA256 takes anything turns it into string :) https://blog.8bitzen.com/posts/22-08-2019-how-to-hash-a-struct-in-go
func AsSHA256(v interface{}) string {
h := sha256.New()
h.Write([]byte(fmt.Sprintf("%v", v)))
return fmt.Sprintf("%x", h.Sum(nil))
}
func SpiffeToSpiffeInfo(spiffe string) (*SpiffeBasicInfo, error) {
basicInfo := &SpiffeBasicInfo{}
pos := strings.Index(spiffe, SpiffePrefix)
if pos < 0 {
return nil, fmt.Errorf("invalid spiffe %s", spiffe)
}
pos += len(SpiffePrefix)
spiffeNoPrefix := spiffe[pos:]
splits := strings.Split(spiffeNoPrefix, "/")
if len(splits) < 3 {
return nil, fmt.Errorf("invalid spiffe %s", spiffe)
}
p0 := strings.Index(splits[0], "-")
p1 := strings.Index(splits[1], "-")
p2 := strings.Index(splits[2], "-")
if p0 == -1 || p1 == -1 || p2 == -1 {
return nil, fmt.Errorf("invalid spiffe %s", spiffe)
}
basicInfo.Level0Type = splits[0][:p0]
basicInfo.Level0 = splits[0][p0+1:]
basicInfo.Level1Type = splits[1][:p1]
basicInfo.Level1 = splits[1][p1+1:]
basicInfo.Kind = splits[2][:p2]
basicInfo.Name = splits[2][p2+1:]
return basicInfo, nil
}
func ImageTagToImageInfo(imageTag string) (*ImageInfo, error) {
ImageInfo := &ImageInfo{}
spDelimiter := "/"
pos := strings.Index(imageTag, spDelimiter)
if pos < 0 {
ImageInfo.Registry = ""
ImageInfo.VersionImage = imageTag
return ImageInfo, nil
}
splits := strings.Split(imageTag, spDelimiter)
if len(splits) == 0 {
return nil, fmt.Errorf("Invalid image info %s", imageTag)
}
ImageInfo.Registry = splits[0]
if len(splits) > 1 {
ImageInfo.VersionImage = splits[len(splits)-1]
} else {
ImageInfo.VersionImage = ""
}
return ImageInfo, nil
}
func BoolPointer(b bool) *bool { return &b }
func BoolToString(b bool) string {
if b {
return "true"
}
return "false"
}
func BoolPointerToString(b *bool) string {
if b == nil {
return ""
}
if *b {
return "true"
}
return "false"
}
func StringToBool(s string) bool {
if strings.ToLower(s) == "true" || strings.ToLower(s) == "1" {
return true
}
return false
}
func StringToBoolPointer(s string) *bool {
if strings.ToLower(s) == "true" || strings.ToLower(s) == "1" {
return BoolPointer(true)
}
if strings.ToLower(s) == "false" || strings.ToLower(s) == "0" {
return BoolPointer(false)
}
return nil
}

View File

@@ -1,52 +0,0 @@
package cautils
import (
"fmt"
"hash/fnv"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var NamespacesListToIgnore = make([]string, 0)
var KubeNamespaces = []string{metav1.NamespaceSystem, metav1.NamespacePublic}
// NamespacesListToIgnore namespaces to ignore if a pod
func InitNamespacesListToIgnore(caNamespace string) {
if len(NamespacesListToIgnore) > 0 {
return
}
NamespacesListToIgnore = append(NamespacesListToIgnore, KubeNamespaces...)
NamespacesListToIgnore = append(NamespacesListToIgnore, caNamespace)
}
func IfIgnoreNamespace(ns string) bool {
for i := range NamespacesListToIgnore {
if NamespacesListToIgnore[i] == ns {
return true
}
}
return false
}
func IfKubeNamespace(ns string) bool {
for i := range KubeNamespaces {
if NamespacesListToIgnore[i] == ns {
return true
}
}
return false
}
func hash(s string) string {
h := fnv.New32a()
h.Write([]byte(s))
return fmt.Sprintf("%d", h.Sum32())
}
func GenarateConfigMapName(wlid string) string {
name := strings.ToLower(fmt.Sprintf("ca-%s-%s-%s", GetNamespaceFromWlid(wlid), GetKindFromWlid(wlid), GetNameFromWlid(wlid)))
if len(name) >= 63 {
name = hash(name)
}
return name
}

View File

@@ -1,238 +0,0 @@
package cautils
import (
"fmt"
"strings"
)
// API fields
var (
WlidPrefix = "wlid://"
SidPrefix = "sid://"
ClusterWlidPrefix = "cluster-"
NamespaceWlidPrefix = "namespace-"
DataCenterWlidPrefix = "datacenter-"
ProjectWlidPrefix = "project-"
SecretSIDPrefix = "secret-"
SubSecretSIDPrefix = "subsecret-"
K8SKindsList = []string{"ComponentStatus", "ConfigMap", "ControllerRevision", "CronJob",
"CustomResourceDefinition", "DaemonSet", "Deployment", "Endpoints", "Event", "HorizontalPodAutoscaler",
"Ingress", "Job", "Lease", "LimitRange", "LocalSubjectAccessReview", "MutatingWebhookConfiguration",
"Namespace", "NetworkPolicy", "Node", "PersistentVolume", "PersistentVolumeClaim", "Pod",
"PodDisruptionBudget", "PodSecurityPolicy", "PodTemplate", "PriorityClass", "ReplicaSet",
"ReplicationController", "ResourceQuota", "Role", "RoleBinding", "Secret", "SelfSubjectAccessReview",
"SelfSubjectRulesReview", "Service", "ServiceAccount", "StatefulSet", "StorageClass",
"SubjectAccessReview", "TokenReview", "ValidatingWebhookConfiguration", "VolumeAttachment"}
NativeKindsList = []string{"Dockerized", "Native"}
KindReverseMap = map[string]string{}
dataImagesList = []string{}
)
func IsWlid(id string) bool {
return strings.HasPrefix(id, WlidPrefix)
}
func IsSid(id string) bool {
return strings.HasPrefix(id, SidPrefix)
}
// GetK8SKindFronList get the calculated wlid
func GetK8SKindFronList(kind string) string { // TODO GetK8SKindFromList
for i := range K8SKindsList {
if strings.ToLower(kind) == strings.ToLower(K8SKindsList[i]) {
return K8SKindsList[i]
}
}
return kind
}
// IsK8SKindInList Check if the kind is a known kind
func IsK8SKindInList(kind string) bool {
for i := range K8SKindsList {
if strings.ToLower(kind) == strings.ToLower(K8SKindsList[i]) {
return true
}
}
return false
}
// generateWLID
func generateWLID(pLevel0, level0, pLevel1, level1, k, name string) string {
kind := strings.ToLower(k)
kind = strings.Replace(kind, "-", "", -1)
wlid := WlidPrefix
wlid += fmt.Sprintf("%s%s", pLevel0, level0)
if level1 == "" {
return wlid
}
wlid += fmt.Sprintf("/%s%s", pLevel1, level1)
if kind == "" {
return wlid
}
wlid += fmt.Sprintf("/%s", kind)
if name == "" {
return wlid
}
wlid += fmt.Sprintf("-%s", name)
return wlid
}
// GetWLID get the calculated wlid
func GetWLID(level0, level1, k, name string) string {
return generateWLID(ClusterWlidPrefix, level0, NamespaceWlidPrefix, level1, k, name)
}
// GetK8sWLID get the k8s calculated wlid
func GetK8sWLID(level0, level1, k, name string) string {
return generateWLID(ClusterWlidPrefix, level0, NamespaceWlidPrefix, level1, k, name)
}
// GetNativeWLID get the native calculated wlid
func GetNativeWLID(level0, level1, k, name string) string {
return generateWLID(DataCenterWlidPrefix, level0, ProjectWlidPrefix, level1, k, name)
}
// WildWlidContainsWlid does WildWlid contains Wlid
func WildWlidContainsWlid(wildWlid, wlid string) bool { // TODO- test
if wildWlid == wlid {
return true
}
wildWlidR, _ := RestoreMicroserviceIDsFromSpiffe(wildWlid)
wlidR, _ := RestoreMicroserviceIDsFromSpiffe(wlid)
if len(wildWlidR) > len(wildWlidR) {
// invalid wlid
return false
}
for i := range wildWlidR {
if wildWlidR[i] != wlidR[i] {
return false
}
}
return true
}
func restoreInnerIdentifiersFromID(spiffeSlices []string) []string {
if len(spiffeSlices) >= 1 && strings.HasPrefix(spiffeSlices[0], ClusterWlidPrefix) {
spiffeSlices[0] = spiffeSlices[0][len(ClusterWlidPrefix):]
}
if len(spiffeSlices) >= 2 && strings.HasPrefix(spiffeSlices[1], NamespaceWlidPrefix) {
spiffeSlices[1] = spiffeSlices[1][len(NamespaceWlidPrefix):]
}
if len(spiffeSlices) >= 3 && strings.Contains(spiffeSlices[2], "-") {
dashIdx := strings.Index(spiffeSlices[2], "-")
spiffeSlices = append(spiffeSlices, spiffeSlices[2][dashIdx+1:])
spiffeSlices[2] = spiffeSlices[2][:dashIdx]
if val, ok := KindReverseMap[spiffeSlices[2]]; ok {
spiffeSlices[2] = val
}
}
return spiffeSlices
}
// RestoreMicroserviceIDsFromSpiffe -
func RestoreMicroserviceIDsFromSpiffe(spiffe string) ([]string, error) {
if spiffe == "" {
return nil, fmt.Errorf("in RestoreMicroserviceIDsFromSpiffe, expecting valid wlid recieved empty string")
}
if StringHasWhitespace(spiffe) {
return nil, fmt.Errorf("wlid %s invalid. whitespace found", spiffe)
}
if strings.HasPrefix(spiffe, WlidPrefix) {
spiffe = spiffe[len(WlidPrefix):]
} else if strings.HasPrefix(spiffe, SidPrefix) {
spiffe = spiffe[len(SidPrefix):]
}
spiffeSlices := strings.Split(spiffe, "/")
// The documented WLID format (https://cyberarmorio.sharepoint.com/sites/development2/Shared%20Documents/kubernetes_design1.docx?web=1)
if len(spiffeSlices) <= 3 {
spiffeSlices = restoreInnerIdentifiersFromID(spiffeSlices)
}
if len(spiffeSlices) != 4 { // first used WLID, deprecated since 24.10.2019
return spiffeSlices, fmt.Errorf("invalid WLID format. format received: %v", spiffeSlices)
}
for i := range spiffeSlices {
if spiffeSlices[i] == "" {
return spiffeSlices, fmt.Errorf("one or more entities are empty, spiffeSlices: %v", spiffeSlices)
}
}
return spiffeSlices, nil
}
// RestoreMicroserviceIDsFromSpiffe -
func RestoreMicroserviceIDs(spiffe string) []string {
if spiffe == "" {
return []string{}
}
if StringHasWhitespace(spiffe) {
return []string{}
}
if strings.HasPrefix(spiffe, WlidPrefix) {
spiffe = spiffe[len(WlidPrefix):]
} else if strings.HasPrefix(spiffe, SidPrefix) {
spiffe = spiffe[len(SidPrefix):]
}
spiffeSlices := strings.Split(spiffe, "/")
return restoreInnerIdentifiersFromID(spiffeSlices)
}
// GetClusterFromWlid parse wlid and get cluster
func GetClusterFromWlid(wlid string) string {
r := RestoreMicroserviceIDs(wlid)
if len(r) >= 1 {
return r[0]
}
return ""
}
// GetNamespaceFromWlid parse wlid and get Namespace
func GetNamespaceFromWlid(wlid string) string {
r := RestoreMicroserviceIDs(wlid)
if len(r) >= 2 {
return r[1]
}
return ""
}
// GetKindFromWlid parse wlid and get kind
func GetKindFromWlid(wlid string) string {
r := RestoreMicroserviceIDs(wlid)
if len(r) >= 3 {
return GetK8SKindFronList(r[2])
}
return ""
}
// GetNameFromWlid parse wlid and get name
func GetNameFromWlid(wlid string) string {
r := RestoreMicroserviceIDs(wlid)
if len(r) >= 4 {
return GetK8SKindFronList(r[3])
}
return ""
}
// IsWlidValid test if wlid is a valid wlid
func IsWlidValid(wlid string) error {
_, err := RestoreMicroserviceIDsFromSpiffe(wlid)
return err
}
// StringHasWhitespace check if a string has whitespace
func StringHasWhitespace(str string) bool {
if whitespace := strings.Index(str, " "); whitespace != -1 {
return true
}
return false
}

View File

@@ -1,49 +0,0 @@
package cautils
import (
"kube-escape/cautils/opapolicy"
)
// K8SResources map[<api group>/<api version>/<resource>]<resource object>
type K8SResources map[string]interface{}
type OPASessionObj struct {
Frameworks []opapolicy.Framework
K8SResources *K8SResources
PostureReport *opapolicy.PostureReport
}
func NewOPASessionObj(frameworks []opapolicy.Framework, k8sResources *K8SResources) *OPASessionObj {
return &OPASessionObj{
Frameworks: frameworks,
K8SResources: k8sResources,
PostureReport: &opapolicy.PostureReport{
ClusterName: ClusterName,
CustomerGUID: CustomerGUID,
},
}
}
func NewOPASessionObjMock() *OPASessionObj {
return &OPASessionObj{
Frameworks: nil,
K8SResources: nil,
PostureReport: &opapolicy.PostureReport{
ClusterName: "",
CustomerGUID: "",
ReportID: "",
JobID: "",
},
}
}
type ComponentConfig struct {
Exceptions Exception `json:"exceptions"`
}
type Exception struct {
Ignore *bool `json:"ignore"` // ignore test results
MultipleScore *opapolicy.AlertScore `json:"multipleScore"` // MultipleScore number - float32
Namespaces []string `json:"namespaces"`
Regex string `json:"regex"` // not supported
}

View File

@@ -1,45 +0,0 @@
package cautils
import (
"fmt"
"os"
"time"
"github.com/briandowns/spinner"
"github.com/fatih/color"
"github.com/mattn/go-isatty"
)
var FailureDisplay = color.New(color.Bold, color.FgHiRed).FprintfFunc()
var FailureTextDisplay = color.New(color.Faint, color.FgHiRed).FprintfFunc()
var InfoDisplay = color.New(color.Bold, color.FgHiYellow).FprintfFunc()
var InfoTextDisplay = color.New(color.Faint, color.FgHiYellow).FprintfFunc()
var SimpleDisplay = color.New(color.Bold, color.FgHiWhite).FprintfFunc()
var SuccessDisplay = color.New(color.Bold, color.FgHiGreen).FprintfFunc()
var Spinner *spinner.Spinner
func SuccessTextDisplay(str string) {
SuccessDisplay(os.Stdout, "[success] ")
SimpleDisplay(os.Stdout, fmt.Sprintf("%s\n", str))
}
func ProgressTextDisplay(str string) {
InfoDisplay(os.Stdout, "[progress] ")
SimpleDisplay(os.Stdout, fmt.Sprintf("%s\n", str))
}
func StartSpinner() {
if isatty.IsTerminal(os.Stdout.Fd()) {
Spinner = spinner.New(spinner.CharSets[7], 100*time.Millisecond) // Build our new spinner
Spinner.Start()
}
}
func StopSpinner() {
if Spinner == nil {
return
}
Spinner.Stop()
}

View File

@@ -1,24 +0,0 @@
package cautils
import (
"os"
)
// CA environment vars
var (
CustomerGUID = ""
ClusterName = ""
EventReceiverURL = ""
NotificationServerURL = ""
DashboardBackendURL = ""
RestAPIPort = "4001"
)
func SetupDefaultEnvs() {
if os.Getenv("CA_DASHBOARD_BACKEND") == "" {
os.Setenv("CA_DASHBOARD_BACKEND", "https://dashbe.eudev3.cyberarmorsoft.com") // use prod
}
if os.Getenv("CA_CUSTOMER_GUID") == "" {
os.Setenv("CA_CUSTOMER_GUID", "11111111-1111-1111-1111-111111111111")
}
}

View File

@@ -1,265 +0,0 @@
package k8sinterface
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ecr"
"github.com/docker/docker/api/types"
)
// For GCR there are some permissions one need to assign in order to allow ARMO to pull images:
// https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
// gcloud iam service-accounts create armo-controller-sa
// gcloud projects add-iam-policy-binding <PROJECT_NAME> --role roles/storage.objectViewer --member "serviceAccount:armo-controller-sa@<PROJECT_NAME>.iam.gserviceaccount.com"
// gcloud iam service-accounts add-iam-policy-binding --role roles/iam.workloadIdentityUser --member "serviceAccount:<PROJECT_NAME>.svc.id.goog[cyberarmor-system/ca-controller-service-account]" armo-controller-sa@<PROJECT_NAME>.iam.gserviceaccount.com
// kubectl annotate serviceaccount --overwrite --namespace cyberarmor-system ca-controller-service-account iam.gke.io/gcp-service-account=armo-controller-sa@<PROJECT_NAME>.iam.gserviceaccount.com
const (
gcrDefaultServiceAccountName = "default"
// armoServiceAccountName = "ca-controller-service-account"
)
var (
httpClient = http.Client{Timeout: 5 * time.Second}
)
// CheckIsECRImage check if this image is suspected as ECR hosted image
func CheckIsECRImage(imageTag string) bool {
return strings.Contains(imageTag, "dkr.ecr")
}
// GetLoginDetailsForECR return user name + password using the default iam-role OR ~/.aws/config of the machine
func GetLoginDetailsForECR(imageTag string) (string, string, error) {
// imageTag := "015253967648.dkr.ecr.eu-central-1.amazonaws.com/armo:1"
imageTagSlices := strings.Split(imageTag, ".")
repo := imageTagSlices[0]
region := imageTagSlices[3]
mySession := session.Must(session.NewSession())
ecrClient := ecr.New(mySession, aws.NewConfig().WithRegion(region))
input := &ecr.GetAuthorizationTokenInput{
RegistryIds: []*string{&repo},
}
res, err := ecrClient.GetAuthorizationToken(input)
if err != nil {
return "", "", fmt.Errorf("in PullFromECR, failed to GetAuthorizationToken: %v", err)
}
res64 := (*res.AuthorizationData[0].AuthorizationToken)
resB, err := base64.StdEncoding.DecodeString(res64)
if err != nil {
return "", "", fmt.Errorf("in PullFromECR, failed to DecodeString: %v", err)
}
delimiterIdx := bytes.IndexByte(resB, ':')
// userName := resB[:delimiterIdx]
// resB = resB[delimiterIdx+1:]
// resB, err = base64.StdEncoding.DecodeString(string(resB))
// if err != nil {
// t.Errorf("failed to DecodeString #2: %v\n\n", err)
// }
return string(resB[:delimiterIdx]), string(resB[delimiterIdx+1:]), nil
}
func CheckIsACRImage(imageTag string) bool {
// atest1.azurecr.io/go-inf:1
return strings.Contains(imageTag, ".azurecr.io/")
}
type azureADDResponseJson struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresIn string `json:"expires_in"`
ExpiresOn string `json:"expires_on"`
NotBefore string `json:"not_before"`
Resource string `json:"resource"`
TokenType string `json:"token_type"`
}
func getAzureAADAccessToken() (string, error) {
msi_endpoint, err := url.Parse("http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01")
if err != nil {
return "", fmt.Errorf("creating URL : %v", err)
}
msi_parameters := url.Values{}
msi_parameters.Add("resource", "https://management.azure.com/")
msi_parameters.Add("api-version", "2018-02-01")
msi_endpoint.RawQuery = msi_parameters.Encode()
req, err := http.NewRequest("GET", msi_endpoint.String(), nil)
if err != nil {
return "", fmt.Errorf("creating HTTP request : %v", err)
}
req.Header.Add("Metadata", "true")
// Call managed services for Azure resources token endpoint
resp, err := httpClient.Do(req)
if err != nil {
return "", fmt.Errorf("calling token endpoint : %v", err)
}
// Pull out response body
responseBytes, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err != nil {
return "", fmt.Errorf("reading response body : %v", err)
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return "", fmt.Errorf("azure ActiveDirectory AT resp: %v, %v", resp.Status, string(responseBytes))
}
// Unmarshall response body into struct
var r azureADDResponseJson
err = json.Unmarshal(responseBytes, &r)
if err != nil {
return "", fmt.Errorf("unmarshalling the response: %v", err)
}
return r.AccessToken, nil
}
// GetLoginDetailsForAzurCR return user name + password to use
func GetLoginDetailsForAzurCR(imageTag string) (string, string, error) {
// imageTag := "atest1.azurecr.io/go-inf:1"
imageTagSlices := strings.Split(imageTag, "/")
azureIdensAT, err := getAzureAADAccessToken()
if err != nil {
return "", "", err
}
atMap := make(map[string]interface{})
azureIdensATSlices := strings.Split(azureIdensAT, ".")
if len(azureIdensATSlices) < 2 {
return "", "", fmt.Errorf("len(azureIdensATSlices) < 2")
}
resB, err := base64.RawStdEncoding.DecodeString(azureIdensATSlices[1])
if err != nil {
return "", "", fmt.Errorf("in GetLoginDetailsForAzurCR, failed to DecodeString: %v, %s", err, azureIdensATSlices[1])
}
if err := json.Unmarshal(resB, &atMap); err != nil {
return "", "", fmt.Errorf("failed to unmarshal azureIdensAT: %v, %s", err, string(resB))
}
// excahnging AAD for ACR refresh token
refreshToken, err := excahngeAzureAADAccessTokenForACRRefreshToken(imageTagSlices[0], fmt.Sprintf("%v", atMap["tid"]), azureIdensAT)
if err != nil {
return "", "", fmt.Errorf("failed to excahngeAzureAADAccessTokenForACRRefreshToken: %v, registry: %s, tenantID: %s, azureAADAT: %s", err, imageTagSlices[0], fmt.Sprintf("%v", atMap["tid"]), azureIdensAT)
}
return "00000000-0000-0000-0000-000000000000", refreshToken, nil
}
func excahngeAzureAADAccessTokenForACRRefreshToken(registry, tenantID, azureAADAT string) (string, error) {
msi_parameters := url.Values{}
msi_parameters.Add("service", registry)
msi_parameters.Add("grant_type", "access_token")
msi_parameters.Add("tenant", tenantID)
msi_parameters.Add("access_token", azureAADAT)
postBodyStr := msi_parameters.Encode()
req, err := http.NewRequest("POST", fmt.Sprintf("https://%v/oauth2/exchange", registry), strings.NewReader(postBodyStr))
if err != nil {
return "", fmt.Errorf("creating HTTP request : %v", err)
}
req.Header.Add("Metadata", "true")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
// Call managed services for Azure resources token endpoint
resp, err := httpClient.Do(req)
if err != nil {
return "", fmt.Errorf("calling token endpoint : %v", err)
}
// Pull out response body
responseBytes, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err != nil {
return "", fmt.Errorf("reading response body : %v", err)
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return "", fmt.Errorf("azure exchange AT resp: %v, %v", resp.Status, string(responseBytes))
}
resultMap := make(map[string]string)
err = json.Unmarshal(responseBytes, &resultMap)
if err != nil {
return "", fmt.Errorf("unmarshalling the response: %v", err)
}
return resultMap["refresh_token"], nil
}
func CheckIsGCRImage(imageTag string) bool {
// gcr.io/elated-pottery-310110/golang-inf:2
return strings.Contains(imageTag, "gcr.io/")
}
// GetLoginDetailsForGCR return user name + password to use
func GetLoginDetailsForGCR(imageTag string) (string, string, error) {
msi_endpoint, err := url.Parse(fmt.Sprintf("http://169.254.169.254/computeMetadata/v1/instance/service-accounts/%s/token", gcrDefaultServiceAccountName))
if err != nil {
return "", "", fmt.Errorf("creating URL : %v", err)
}
req, err := http.NewRequest("GET", msi_endpoint.String(), nil)
if err != nil {
return "", "", fmt.Errorf("creating HTTP request : %v", err)
}
req.Header.Add("Metadata-Flavor", "Google")
// Call managed services for Azure resources token endpoint
resp, err := httpClient.Do(req)
if err != nil {
return "", "", fmt.Errorf("calling token endpoint : %v", err)
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return "", "", fmt.Errorf("HTTP Status : %v, make sure the '%s' service account is configured for ARMO pod", resp.Status, gcrDefaultServiceAccountName)
}
defer resp.Body.Close()
respMap := make(map[string]interface{})
if err := json.NewDecoder(resp.Body).Decode(&respMap); err != nil {
return "", "", fmt.Errorf("json Decode : %v", err)
}
return "oauth2accesstoken", fmt.Sprintf("%v", respMap["access_token"]), nil
}
func GetCloudVendorRegistryCredentials(imageTag string) (map[string]types.AuthConfig, error) {
secrets := map[string]types.AuthConfig{}
var errRes error
if CheckIsACRImage(imageTag) {
userName, password, err := GetLoginDetailsForAzurCR(imageTag)
if err != nil {
errRes = fmt.Errorf("failed to GetLoginDetailsForACR(%s): %v", imageTag, err)
} else {
secrets[imageTag] = types.AuthConfig{
Username: userName,
Password: password,
}
}
}
if CheckIsECRImage(imageTag) {
userName, password, err := GetLoginDetailsForECR(imageTag)
if err != nil {
errRes = fmt.Errorf("failed to GetLoginDetailsForECR(%s): %v", imageTag, err)
} else {
secrets[imageTag] = types.AuthConfig{
Username: userName,
Password: password,
}
}
}
if CheckIsGCRImage(imageTag) {
userName, password, err := GetLoginDetailsForGCR(imageTag)
if err != nil {
errRes = fmt.Errorf("failed to GetLoginDetailsForGCR(%s): %v", imageTag, err)
} else {
secrets[imageTag] = types.AuthConfig{
Username: userName,
Password: password,
}
}
}
return secrets, errRes
}

View File

@@ -1,73 +0,0 @@
package k8sinterface
import (
"context"
"fmt"
"os"
"path/filepath"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
// DO NOT REMOVE - load cloud providers auth
_ "k8s.io/client-go/plugin/pkg/client/auth"
)
// K8SConfig pointer to k8s config
var K8SConfig *restclient.Config
// KubernetesApi -
type KubernetesApi struct {
KubernetesClient kubernetes.Interface
DynamicClient dynamic.Interface
Context context.Context
}
// NewKubernetesApi -
func NewKubernetesApi() *KubernetesApi {
kubernetesClient, err := kubernetes.NewForConfig(GetK8sConfig())
if err != nil {
panic(fmt.Sprintf("kubernetes.NewForConfig - Failed to load config file, reason: %s", err.Error()))
}
dynamicClient, err := dynamic.NewForConfig(GetK8sConfig())
if err != nil {
panic(fmt.Sprintf("dynamic.NewForConfig - Failed to load config file, reason: %s", err.Error()))
}
return &KubernetesApi{
KubernetesClient: kubernetesClient,
DynamicClient: dynamicClient,
Context: context.Background(),
}
}
var ConfigPath = filepath.Join(os.Getenv("HOME"), ".kube", "config")
var RunningIncluster bool
// LoadK8sConfig load config from local file or from cluster
func LoadK8sConfig() error {
kubeconfig, err := clientcmd.BuildConfigFromFlags("", ConfigPath)
if err != nil {
kubeconfig, err = restclient.InClusterConfig()
if err != nil {
return fmt.Errorf("Failed to load kubernetes config from file: '%s', err: %v", ConfigPath, err)
}
RunningIncluster = true
} else {
RunningIncluster = false
}
K8SConfig = kubeconfig
return nil
}
// GetK8sConfig get config. load if not loaded yer
func GetK8sConfig() *restclient.Config {
if K8SConfig == nil {
if err := LoadK8sConfig(); err != nil {
return nil
}
}
return K8SConfig
}

View File

@@ -1,26 +0,0 @@
package k8sinterface
import (
"testing"
"kube-escape/cautils/cautils"
)
func TestGetGroupVersionResource(t *testing.T) {
wlid := "wlid://cluster-david-v1/namespace-default/deployment-nginx-deployment"
r, err := GetGroupVersionResource(cautils.GetKindFromWlid(wlid))
if err != nil {
t.Error(err)
return
}
if r.Group != "apps" {
t.Errorf("wrong group")
}
if r.Version != "v1" {
t.Errorf("wrong Version")
}
if r.Resource != "deployments" {
t.Errorf("wrong Resource")
}
}

View File

@@ -1,145 +0,0 @@
package k8sinterface
import (
"fmt"
"strings"
"kube-escape/cautils/cautils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
//
// Uncomment to load all auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth
//
// Or uncomment to load specific auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth/azure"
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
// _ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
)
func (k8sAPI *KubernetesApi) GetWorkloadByWlid(wlid string) (*Workload, error) {
return k8sAPI.GetWorkload(cautils.GetNamespaceFromWlid(wlid), cautils.GetKindFromWlid(wlid), cautils.GetNameFromWlid(wlid))
}
func (k8sAPI *KubernetesApi) GetWorkload(namespace, kind, name string) (*Workload, error) {
groupVersionResource, err := GetGroupVersionResource(kind)
if err != nil {
return nil, err
}
w, err := k8sAPI.ResourceInterface(&groupVersionResource, namespace).Get(k8sAPI.Context, name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to GET resource, kind: '%s', namespace: '%s', name: '%s', reason: %s", kind, namespace, name, err.Error())
}
return NewWorkloadObj(w.Object), nil
}
func (k8sAPI *KubernetesApi) ListWorkloads(groupVersionResource *schema.GroupVersionResource, namespace string, podLabels, fieldSelector map[string]string) ([]Workload, error) {
listOptions := metav1.ListOptions{}
if podLabels != nil && len(podLabels) > 0 {
set := labels.Set(podLabels)
listOptions.LabelSelector = SelectorToString(set)
}
if fieldSelector != nil && len(fieldSelector) > 0 {
set := labels.Set(fieldSelector)
listOptions.FieldSelector = SelectorToString(set)
}
uList, err := k8sAPI.ResourceInterface(groupVersionResource, namespace).List(k8sAPI.Context, listOptions)
if err != nil {
return nil, fmt.Errorf("failed to LIST resources, reason: %s", err.Error())
}
workloads := make([]Workload, len(uList.Items))
for i := range uList.Items {
workloads[i] = *NewWorkloadObj(uList.Items[i].Object)
}
return workloads, nil
}
func (k8sAPI *KubernetesApi) DeleteWorkloadByWlid(wlid string) error {
groupVersionResource, err := GetGroupVersionResource(cautils.GetKindFromWlid(wlid))
if err != nil {
return err
}
err = k8sAPI.ResourceInterface(&groupVersionResource, cautils.GetNamespaceFromWlid(wlid)).Delete(k8sAPI.Context, cautils.GetNameFromWlid(wlid), metav1.DeleteOptions{})
if err != nil {
return fmt.Errorf("failed to DELETE resource, workloadID: '%s', reason: %s", wlid, err.Error())
}
return nil
}
func (k8sAPI *KubernetesApi) CreateWorkload(workload *Workload) (*Workload, error) {
groupVersionResource, err := GetGroupVersionResource(workload.GetKind())
if err != nil {
return nil, err
}
obj, err := workload.ToUnstructured()
if err != nil {
return nil, err
}
w, err := k8sAPI.ResourceInterface(&groupVersionResource, workload.GetNamespace()).Create(k8sAPI.Context, obj, metav1.CreateOptions{})
if err != nil {
return nil, fmt.Errorf("failed to CREATE resource, workload: '%s', reason: %s", workload.Json(), err.Error())
}
return NewWorkloadObj(w.Object), nil
}
func (k8sAPI *KubernetesApi) UpdateWorkload(workload *Workload) (*Workload, error) {
groupVersionResource, err := GetGroupVersionResource(workload.GetKind())
if err != nil {
return nil, err
}
obj, err := workload.ToUnstructured()
if err != nil {
return nil, err
}
w, err := k8sAPI.ResourceInterface(&groupVersionResource, workload.GetNamespace()).Update(k8sAPI.Context, obj, metav1.UpdateOptions{})
if err != nil {
return nil, fmt.Errorf("failed to UPDATE resource, workload: '%s', reason: %s", workload.Json(), err.Error())
}
return NewWorkloadObj(w.Object), nil
}
func (k8sAPI *KubernetesApi) GetNamespace(ns string) (*Workload, error) {
groupVersionResource, err := GetGroupVersionResource("namespace")
if err != nil {
return nil, err
}
w, err := k8sAPI.DynamicClient.Resource(groupVersionResource).Get(k8sAPI.Context, ns, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get namespace: '%s', reason: %s", ns, err.Error())
}
return NewWorkloadObj(w.Object), nil
}
func (k8sAPI *KubernetesApi) ResourceInterface(resource *schema.GroupVersionResource, namespace string) dynamic.ResourceInterface {
if IsNamespaceScope(resource.Group, resource.Resource) {
return k8sAPI.DynamicClient.Resource(*resource).Namespace(namespace)
}
return k8sAPI.DynamicClient.Resource(*resource)
}
func (k8sAPI *KubernetesApi) CalculateWorkloadParentRecursive(workload *Workload) (string, string, error) {
ownerReferences, err := workload.GetOwnerReferences() // OwnerReferences in workload
if err != nil {
return workload.GetKind(), workload.GetName(), err
}
if len(ownerReferences) == 0 {
return workload.GetKind(), workload.GetName(), nil // parent found
}
ownerReference := ownerReferences[0]
parentWorkload, err := k8sAPI.GetWorkload(workload.GetNamespace(), ownerReference.Kind, ownerReference.Name)
if err != nil {
if strings.Contains(err.Error(), "not found in resourceMap") { // if parent is RCD
return workload.GetKind(), workload.GetName(), nil // parent found
}
return workload.GetKind(), workload.GetName(), err
}
return k8sAPI.CalculateWorkloadParentRecursive(parentWorkload)
}

View File

@@ -1,43 +0,0 @@
package k8sinterface
import (
"context"
"k8s.io/apimachinery/pkg/runtime"
dynamicfake "k8s.io/client-go/dynamic/fake"
kubernetesfake "k8s.io/client-go/kubernetes/fake"
//
// metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// Uncomment to load all auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth
//
// Or uncomment to load specific auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth/azure"
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
// _ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
)
// NewKubernetesApi -
func NewKubernetesApiMock() *KubernetesApi {
return &KubernetesApi{
KubernetesClient: kubernetesfake.NewSimpleClientset(),
DynamicClient: dynamicfake.NewSimpleDynamicClient(&runtime.Scheme{}),
Context: context.Background(),
}
}
// func TestListDynamic(t *testing.T) {
// k8s := NewKubernetesApi()
// resource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
// clientResource, err := k8s.DynamicClient.Resource(resource).Namespace("default").List(k8s.Context, metav1.ListOptions{})
// if err != nil {
// t.Errorf("err: %v", err)
// } else {
// bla, _ := json.Marshal(clientResource)
// // t.Errorf("BearerToken: %v", *K8SConfig)
// // ioutil.WriteFile("bla.json", bla, 777)
// t.Errorf("clientResource: %s", string(bla))
// }
// }

View File

@@ -1,66 +0,0 @@
package k8sinterface
import (
"sort"
"strings"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/labels"
)
//
// Uncomment to load all auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth
//
// Or uncomment to load specific auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth/azure"
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
// _ "k8s.io/client-go/plugin/pkg/client/auth/openstack"
func ConvertUnstructuredSliceToMap(unstructuredSlice []unstructured.Unstructured) []map[string]interface{} {
converted := make([]map[string]interface{}, len(unstructuredSlice))
for i := range unstructuredSlice {
converted[i] = unstructuredSlice[i].Object
}
return converted
}
func FilterOutOwneredResources(result []unstructured.Unstructured) []unstructured.Unstructured {
response := []unstructured.Unstructured{}
recognizedOwners := []string{"Deployment", "ReplicaSet", "DaemonSet", "StatefulSet", "Job", "CronJob"}
for i := range result {
ownerReferences := result[i].GetOwnerReferences()
if len(ownerReferences) == 0 {
response = append(response, result[i])
} else if !IsStringInSlice(recognizedOwners, ownerReferences[0].Kind) {
response = append(response, result[i])
}
}
return response
}
func IsStringInSlice(slice []string, val string) bool {
for _, item := range slice {
if item == val {
return true
}
}
return false
}
// String returns all labels listed as a human readable string.
// Conveniently, exactly the format that ParseSelector takes.
func SelectorToString(ls labels.Set) string {
selector := make([]string, 0, len(ls))
for key, value := range ls {
if value != "" {
selector = append(selector, key+"="+value)
} else {
selector = append(selector, key)
}
}
// Sort for determinism.
sort.StringSlice(selector).Sort()
return strings.Join(selector, ",")
}

View File

@@ -1,10 +0,0 @@
package k8sinterface
import "testing"
func TestConvertUnstructuredSliceToMap(t *testing.T) {
converted := ConvertUnstructuredSliceToMap(V1KubeSystemNamespaceMock().Items)
if len(converted) == 0 { // != 7
t.Errorf("len(converted) == 0")
}
}

View File

@@ -1,71 +0,0 @@
package k8sinterface
import (
"context"
"kube-escape/cautils/cautils"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
)
func IsAttached(labels map[string]string) *bool {
return IsLabel(labels, cautils.ArmoAttach)
}
func IsAgentCompatibleLabel(labels map[string]string) *bool {
return IsLabel(labels, cautils.ArmoCompatibleLabel)
}
func IsAgentCompatibleAnnotation(annotations map[string]string) *bool {
return IsLabel(annotations, cautils.ArmoCompatibleAnnotation)
}
func SetAgentCompatibleLabel(labels map[string]string, val bool) {
SetLabel(labels, cautils.ArmoCompatibleLabel, val)
}
func SetAgentCompatibleAnnotation(annotations map[string]string, val bool) {
SetLabel(annotations, cautils.ArmoCompatibleAnnotation, val)
}
func IsLabel(labels map[string]string, key string) *bool {
if labels == nil || len(labels) == 0 {
return nil
}
var k bool
if l, ok := labels[key]; ok {
if l == "true" {
k = true
} else if l == "false" {
k = false
}
return &k
}
return nil
}
func SetLabel(labels map[string]string, key string, val bool) {
if labels == nil {
return
}
v := ""
if val {
v = "true"
} else {
v = "false"
}
labels[key] = v
}
func (k8sAPI *KubernetesApi) ListAttachedPods(namespace string) ([]corev1.Pod, error) {
return k8sAPI.ListPods(namespace, map[string]string{cautils.ArmoAttach: cautils.BoolToString(true)})
}
func (k8sAPI *KubernetesApi) ListPods(namespace string, podLabels map[string]string) ([]corev1.Pod, error) {
listOptions := metav1.ListOptions{}
if podLabels != nil && len(podLabels) > 0 {
set := labels.Set(podLabels)
listOptions.LabelSelector = set.AsSelector().String()
}
pods, err := k8sAPI.KubernetesClient.CoreV1().Pods(namespace).List(context.Background(), listOptions)
if err != nil {
return []corev1.Pod{}, err
}
return pods.Items, nil
}

File diff suppressed because one or more lines are too long

View File

@@ -1,134 +0,0 @@
package k8sinterface
import (
"fmt"
"strings"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const ValueNotFound = -1
// https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#-strong-api-groups-strong-
var ResourceGroupMapping = map[string]string{
"services": "/v1",
"pods": "/v1",
"replicationcontrollers": "/v1",
"podtemplates": "/v1",
"namespaces": "/v1",
"nodes": "/v1",
"configmaps": "/v1",
"secrets": "/v1",
"serviceaccounts": "/v1",
"persistentvolumeclaims": "/v1",
"limitranges": "/v1",
"resourcequotas": "/v1",
"daemonsets": "apps/v1",
"deployments": "apps/v1",
"replicasets": "apps/v1",
"statefulsets": "apps/v1",
"controllerrevisions": "apps/v1",
"jobs": "batch/v1",
"cronjobs": "batch/v1beta1",
"horizontalpodautoscalers": "autoscaling/v1",
"ingresses": "extensions/v1beta1",
"networkpolicies": "networking.k8s.io/v1",
"clusterroles": "rbac.authorization.k8s.io/v1",
"clusterrolebindings": "rbac.authorization.k8s.io/v1",
"roles": "rbac.authorization.k8s.io/v1",
"rolebindings": "rbac.authorization.k8s.io/v1",
"mutatingwebhookconfigurations": "admissionregistration.k8s.io/v1",
"validatingwebhookconfigurations": "admissionregistration.k8s.io/v1",
}
var GroupsClusterScope = []string{}
var ResourceClusterScope = []string{"nodes", "namespaces", "clusterroles", "clusterrolebindings"}
func GetGroupVersionResource(resource string) (schema.GroupVersionResource, error) {
resource = strings.ToLower(resource)
if resource != "" && !strings.HasSuffix(resource, "s") {
resource = fmt.Sprintf("%ss", resource) // add 's' at the end of a resource
}
if r, ok := ResourceGroupMapping[resource]; ok {
gv := strings.Split(r, "/")
return schema.GroupVersionResource{Group: gv[0], Version: gv[1], Resource: resource}, nil
}
return schema.GroupVersionResource{}, fmt.Errorf("resource '%s' not found in resourceMap", resource)
}
func IsNamespaceScope(apiGroup, resource string) bool {
return StringInSlice(GroupsClusterScope, apiGroup) == ValueNotFound &&
StringInSlice(ResourceClusterScope, resource) == ValueNotFound
}
func StringInSlice(strSlice []string, str string) int {
for i := range strSlice {
if strSlice[i] == str {
return i
}
}
return ValueNotFound
}
func JoinResourceTriplets(group, version, resource string) string {
return fmt.Sprintf("%s/%s/%s", group, version, resource)
}
func GetResourceTriplets(group, version, resource string) []string {
resourceTriplets := []string{}
if resource == "" {
// load full map
for k, v := range ResourceGroupMapping {
g := strings.Split(v, "/")
resourceTriplets = append(resourceTriplets, JoinResourceTriplets(g[0], g[1], k))
}
} else if version == "" {
// load by resource
if v, ok := ResourceGroupMapping[resource]; ok {
g := strings.Split(v, "/")
if group == "" {
group = g[0]
}
resourceTriplets = append(resourceTriplets, JoinResourceTriplets(group, g[1], resource))
} else {
glog.Errorf("Resource '%s' unknown", resource)
}
} else if group == "" {
// load by resource and version
if v, ok := ResourceGroupMapping[resource]; ok {
g := strings.Split(v, "/")
resourceTriplets = append(resourceTriplets, JoinResourceTriplets(g[0], version, resource))
} else {
glog.Errorf("Resource '%s' unknown", resource)
}
} else {
resourceTriplets = append(resourceTriplets, JoinResourceTriplets(group, version, resource))
}
return resourceTriplets
}
func ResourceGroupToString(group, version, resource string) []string {
if group == "*" {
group = ""
}
if version == "*" {
version = ""
}
if resource == "*" {
resource = ""
}
resource = strings.ToLower(resource)
if resource != "" && !strings.HasSuffix(resource, "s") {
resource = fmt.Sprintf("%ss", resource) // add 's' at the end of a resource
}
return GetResourceTriplets(group, version, resource)
}
func StringToResourceGroup(str string) (string, string, string) {
splitted := strings.Split(str, "/")
for i := range splitted {
if splitted[i] == "*" {
splitted[i] = ""
}
}
return splitted[0], splitted[1], splitted[2]
}

View File

@@ -1,22 +0,0 @@
package k8sinterface
import "testing"
func TestResourceGroupToString(t *testing.T) {
allResources := ResourceGroupToString("*", "*", "*")
if len(allResources) != len(ResourceGroupMapping) {
t.Errorf("Expected len: %d, received: %d", len(ResourceGroupMapping), len(allResources))
}
pod := ResourceGroupToString("*", "*", "Pod")
if len(pod) == 0 || pod[0] != "/v1/pods" {
t.Errorf("pod: %v", pod)
}
deployments := ResourceGroupToString("*", "*", "Deployment")
if len(deployments) == 0 || deployments[0] != "apps/v1/deployments" {
t.Errorf("deployments: %v", deployments)
}
cronjobs := ResourceGroupToString("*", "*", "cronjobs")
if len(cronjobs) == 0 || cronjobs[0] != "batch/v1beta1/cronjobs" {
t.Errorf("cronjobs: %v", cronjobs)
}
}

View File

@@ -1,149 +0,0 @@
package k8sinterface
import (
"encoding/json"
"fmt"
"kube-escape/cautils/apis"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
type IWorkload interface {
IBasicWorkload
// GET
GetWlid() string
GetJobID() *apis.JobTracking
// SET
SetWlid(string)
SetInject()
SetIgnore()
SetUpdateTime()
SetJobID(apis.JobTracking)
SetCompatible()
SetIncompatible()
// EXIST
IsIgnore() bool
IsInject() bool
IsAttached() bool
IsCompatible() bool
IsIncompatible() bool
// REMOVE
RemoveWlid()
RemoveInject()
RemoveIgnore()
RemoveUpdateTime()
RemoveJobID()
RemoveCompatible()
RemoveArmoMetadata()
RemoveArmoLabels()
RemoveArmoAnnotations()
}
type IBasicWorkload interface {
// Set
SetKind(string)
SetWorkload(map[string]interface{})
SetLabel(key, value string)
SetAnnotation(key, value string)
SetNamespace(string)
SetName(string)
// Get
GetNamespace() string
GetName() string
GetGenerateName() string
GetApiVersion() string
GetKind() string
GetInnerAnnotation() (string, bool)
GetPodAnnotation() (string, bool)
GetAnnotation(string) (string, bool)
GetLabel(string) (string, bool)
GetAnnotations() map[string]string
GetInnerAnnotations() map[string]string
GetPodAnnotations() map[string]string
GetLabels() map[string]string
GetInnerLabels() map[string]string
GetPodLabels() map[string]string
GetJobLabels() map[string]string
GetVolumes() []corev1.Volume
GetContainers() []corev1.Container
GetInitContainers() []corev1.Container
GetOwnerReferences() ([]metav1.OwnerReference, error)
GetImagePullSecret() ([]corev1.LocalObjectReference, error)
GetServiceAccountName() string
GetSelector() (*metav1.LabelSelector, error)
GetResourceVersion() string
GetUID() string
GetWorkload() map[string]interface{}
// REMOVE
RemoveLabel(string)
RemoveAnnotation(string)
RemovePodStatus()
RemoveResourceVersion()
}
type Workload struct {
workload map[string]interface{}
}
func NewWorkload(bWorkload []byte) (*Workload, error) {
workload := make(map[string]interface{})
if bWorkload != nil {
if err := json.Unmarshal(bWorkload, &workload); err != nil {
return nil, err
}
}
return &Workload{
workload: workload,
}, nil
}
func NewWorkloadObj(workload map[string]interface{}) *Workload {
return &Workload{
workload: workload,
}
}
func (w *Workload) Json() string {
if w.workload == nil {
return ""
}
bWorkload, err := json.Marshal(w.workload)
if err != nil {
return err.Error()
}
return fmt.Sprintf("%s", bWorkload)
}
func (workload *Workload) DeepCopy(w map[string]interface{}) {
workload.workload = make(map[string]interface{})
byt, _ := json.Marshal(w)
json.Unmarshal(byt, &workload.workload)
}
func (w *Workload) ToUnstructured() (*unstructured.Unstructured, error) {
obj := &unstructured.Unstructured{}
if w.workload == nil {
return obj, nil
}
bWorkload, err := json.Marshal(w.workload)
if err != nil {
return obj, err
}
if err := json.Unmarshal(bWorkload, obj); err != nil {
return obj, err
}
return obj, nil
}

View File

@@ -1,657 +0,0 @@
package k8sinterface
import (
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
"kube-escape/cautils/apis"
"kube-escape/cautils/cautils"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ======================================= DELETE ========================================
func (w *Workload) RemoveInject() {
w.RemovePodLabel(cautils.CAInject) // DEPRECATED
w.RemovePodLabel(cautils.CAAttachLabel) // DEPRECATED
w.RemovePodLabel(cautils.ArmoAttach)
w.RemoveLabel(cautils.CAInject) // DEPRECATED
w.RemoveLabel(cautils.CAAttachLabel) // DEPRECATED
w.RemoveLabel(cautils.ArmoAttach)
}
func (w *Workload) RemoveIgnore() {
w.RemovePodLabel(cautils.CAIgnore) // DEPRECATED
w.RemovePodLabel(cautils.ArmoAttach)
w.RemoveLabel(cautils.CAIgnore) // DEPRECATED
w.RemoveLabel(cautils.ArmoAttach)
}
func (w *Workload) RemoveWlid() {
w.RemovePodAnnotation(cautils.CAWlid) // DEPRECATED
w.RemovePodAnnotation(cautils.ArmoWlid)
w.RemoveAnnotation(cautils.CAWlid) // DEPRECATED
w.RemoveAnnotation(cautils.ArmoWlid)
}
func (w *Workload) RemoveCompatible() {
w.RemovePodAnnotation(cautils.ArmoCompatibleAnnotation)
}
func (w *Workload) RemoveJobID() {
w.RemovePodAnnotation(cautils.ArmoJobIDPath)
w.RemovePodAnnotation(cautils.ArmoJobParentPath)
w.RemovePodAnnotation(cautils.ArmoJobActionPath)
w.RemoveAnnotation(cautils.ArmoJobIDPath)
w.RemoveAnnotation(cautils.ArmoJobParentPath)
w.RemoveAnnotation(cautils.ArmoJobActionPath)
}
func (w *Workload) RemoveArmoMetadata() {
w.RemoveArmoLabels()
w.RemoveArmoAnnotations()
}
func (w *Workload) RemoveArmoAnnotations() {
l := w.GetAnnotations()
if l != nil {
for k := range l {
if strings.HasPrefix(k, cautils.ArmoPrefix) {
w.RemoveAnnotation(k)
}
if strings.HasPrefix(k, cautils.CAPrefix) { // DEPRECATED
w.RemoveAnnotation(k)
}
}
}
lp := w.GetPodAnnotations()
if lp != nil {
for k := range lp {
if strings.HasPrefix(k, cautils.ArmoPrefix) {
w.RemovePodAnnotation(k)
}
if strings.HasPrefix(k, cautils.CAPrefix) { // DEPRECATED
w.RemovePodAnnotation(k)
}
}
}
}
func (w *Workload) RemoveArmoLabels() {
l := w.GetLabels()
if l != nil {
for k := range l {
if strings.HasPrefix(k, cautils.ArmoPrefix) {
w.RemoveLabel(k)
}
if strings.HasPrefix(k, cautils.CAPrefix) { // DEPRECATED
w.RemoveLabel(k)
}
}
}
lp := w.GetPodLabels()
if lp != nil {
for k := range lp {
if strings.HasPrefix(k, cautils.ArmoPrefix) {
w.RemovePodLabel(k)
}
if strings.HasPrefix(k, cautils.CAPrefix) { // DEPRECATED
w.RemovePodLabel(k)
}
}
}
}
func (w *Workload) RemoveUpdateTime() {
// remove from pod
w.RemovePodAnnotation(cautils.CAUpdate) // DEPRECATED
w.RemovePodAnnotation(cautils.ArmoUpdate)
// remove from workload
w.RemoveAnnotation(cautils.CAUpdate) // DEPRECATED
w.RemoveAnnotation(cautils.ArmoUpdate)
}
func (w *Workload) RemovePodStatus() {
delete(w.workload, "status")
}
func (w *Workload) RemoveResourceVersion() {
if _, ok := w.workload["metadata"]; !ok {
return
}
meta, _ := w.workload["metadata"].(map[string]interface{})
delete(meta, "resourceVersion")
}
func (w *Workload) RemoveLabel(key string) {
w.RemoveMetadata([]string{"metadata"}, "labels", key)
}
func (w *Workload) RemoveAnnotation(key string) {
w.RemoveMetadata([]string{"metadata"}, "annotations", key)
}
func (w *Workload) RemovePodAnnotation(key string) {
w.RemoveMetadata(PodMetadata(w.GetKind()), "annotations", key)
}
func (w *Workload) RemovePodLabel(key string) {
w.RemoveMetadata(PodMetadata(w.GetKind()), "labels", key)
}
func (w *Workload) RemoveMetadata(scope []string, metadata, key string) {
workload := w.workload
for i := range scope {
if _, ok := workload[scope[i]]; !ok {
return
}
workload, _ = workload[scope[i]].(map[string]interface{})
}
if _, ok := workload[metadata]; !ok {
return
}
labels, _ := workload[metadata].(map[string]interface{})
delete(labels, key)
}
// ========================================= SET =========================================
func (w *Workload) SetWorkload(workload map[string]interface{}) {
w.workload = workload
}
func (w *Workload) SetKind(kind string) {
w.workload["kind"] = kind
}
func (w *Workload) SetInject() {
w.SetPodLabel(cautils.ArmoAttach, cautils.BoolToString(true))
}
func (w *Workload) SetJobID(jobTracking apis.JobTracking) {
w.SetPodAnnotation(cautils.ArmoJobIDPath, jobTracking.JobID)
w.SetPodAnnotation(cautils.ArmoJobParentPath, jobTracking.ParentID)
w.SetPodAnnotation(cautils.ArmoJobActionPath, fmt.Sprintf("%d", jobTracking.LastActionNumber))
}
func (w *Workload) SetIgnore() {
w.SetPodLabel(cautils.ArmoAttach, cautils.BoolToString(false))
}
func (w *Workload) SetCompatible() {
w.SetPodAnnotation(cautils.ArmoCompatibleAnnotation, cautils.BoolToString(true))
}
func (w *Workload) SetIncompatible() {
w.SetPodAnnotation(cautils.ArmoCompatibleAnnotation, cautils.BoolToString(false))
}
func (w *Workload) SetReplaceheaders() {
w.SetPodAnnotation(cautils.ArmoReplaceheaders, cautils.BoolToString(true))
}
func (w *Workload) SetWlid(wlid string) {
w.SetPodAnnotation(cautils.ArmoWlid, wlid)
}
func (w *Workload) SetUpdateTime() {
w.SetPodAnnotation(cautils.ArmoUpdate, string(time.Now().UTC().Format("02-01-2006 15:04:05")))
}
func (w *Workload) SetNamespace(namespace string) {
w.SetMetadata([]string{"metadata"}, "namespace", namespace)
}
func (w *Workload) SetName(name string) {
w.SetMetadata([]string{"metadata"}, "name", name)
}
func (w *Workload) SetLabel(key, value string) {
w.SetMetadata([]string{"metadata", "labels"}, key, value)
}
func (w *Workload) SetPodLabel(key, value string) {
w.SetMetadata(append(PodMetadata(w.GetKind()), "labels"), key, value)
}
func (w *Workload) SetAnnotation(key, value string) {
w.SetMetadata([]string{"metadata", "annotations"}, key, value)
}
func (w *Workload) SetPodAnnotation(key, value string) {
w.SetMetadata(append(PodMetadata(w.GetKind()), "annotations"), key, value)
}
func (w *Workload) SetMetadata(scope []string, key string, val interface{}) {
workload := w.workload
for i := range scope {
if _, ok := workload[scope[i]]; !ok {
workload[scope[i]] = make(map[string]interface{})
}
workload, _ = workload[scope[i]].(map[string]interface{})
}
workload[key] = val
}
// ========================================= GET =========================================
func (w *Workload) GetWorkload() map[string]interface{} {
return w.workload
}
func (w *Workload) GetNamespace() string {
if v, ok := InspectWorkload(w.workload, "metadata", "namespace"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetName() string {
if v, ok := InspectWorkload(w.workload, "metadata", "name"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetApiVersion() string {
if v, ok := InspectWorkload(w.workload, "apiVersion"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetGenerateName() string {
if v, ok := InspectWorkload(w.workload, "metadata", "generateName"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetKind() string {
if v, ok := InspectWorkload(w.workload, "kind"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetSelector() (*metav1.LabelSelector, error) {
selector := &metav1.LabelSelector{}
if v, ok := InspectWorkload(w.workload, "spec", "selector", "matchLabels"); ok && v != nil {
b, err := json.Marshal(v)
if err != nil {
return selector, err
}
if err := json.Unmarshal(b, selector); err != nil {
return selector, err
}
return selector, nil
}
return selector, nil
}
func (w *Workload) GetAnnotation(annotation string) (string, bool) {
if v, ok := InspectWorkload(w.workload, "metadata", "annotations", annotation); ok {
return v.(string), ok
}
return "", false
}
func (w *Workload) GetLabel(label string) (string, bool) {
if v, ok := InspectWorkload(w.workload, "metadata", "labels", label); ok {
return v.(string), ok
}
return "", false
}
func (w *Workload) GetPodLabel(label string) (string, bool) {
if v, ok := InspectWorkload(w.workload, append(PodMetadata(w.GetKind()), "labels", label)...); ok && v != nil {
return v.(string), ok
}
return "", false
}
func (w *Workload) GetLabels() map[string]string {
if v, ok := InspectWorkload(w.workload, "metadata", "labels"); ok && v != nil {
labels := make(map[string]string)
for k, i := range v.(map[string]interface{}) {
labels[k] = i.(string)
}
return labels
}
return nil
}
// GetInnerLabels - DEPRECATED
func (w *Workload) GetInnerLabels() map[string]string {
return w.GetPodLabels()
}
func (w *Workload) GetPodLabels() map[string]string {
if v, ok := InspectWorkload(w.workload, append(PodMetadata(w.GetKind()), "labels")...); ok && v != nil {
labels := make(map[string]string)
for k, i := range v.(map[string]interface{}) {
labels[k] = i.(string)
}
return labels
}
return nil
}
// GetInnerAnnotations - DEPRECATED
func (w *Workload) GetInnerAnnotations() map[string]string {
return w.GetPodAnnotations()
}
// GetPodAnnotations
func (w *Workload) GetPodAnnotations() map[string]string {
if v, ok := InspectWorkload(w.workload, append(PodMetadata(w.GetKind()), "annotations")...); ok && v != nil {
annotations := make(map[string]string)
for k, i := range v.(map[string]interface{}) {
annotations[k] = fmt.Sprintf("%v", i)
}
return annotations
}
return nil
}
// GetInnerAnnotation DEPRECATED
func (w *Workload) GetInnerAnnotation(annotation string) (string, bool) {
return w.GetPodAnnotation(annotation)
}
func (w *Workload) GetPodAnnotation(annotation string) (string, bool) {
if v, ok := InspectWorkload(w.workload, append(PodMetadata(w.GetKind()), "annotations", annotation)...); ok && v != nil {
return v.(string), ok
}
return "", false
}
func (w *Workload) GetAnnotations() map[string]string {
if v, ok := InspectWorkload(w.workload, "metadata", "annotations"); ok && v != nil {
annotations := make(map[string]string)
for k, i := range v.(map[string]interface{}) {
annotations[k] = fmt.Sprintf("%v", i)
}
return annotations
}
return nil
}
// GetVolumes -
func (w *Workload) GetVolumes() ([]corev1.Volume, error) {
volumes := []corev1.Volume{}
interVolumes, _ := InspectWorkload(w.workload, append(PodSpec(w.GetKind()), "volumes")...)
if interVolumes == nil {
return volumes, nil
}
volumesBytes, err := json.Marshal(interVolumes)
if err != nil {
return volumes, err
}
err = json.Unmarshal(volumesBytes, &volumes)
return volumes, err
}
func (w *Workload) GetServiceAccountName() string {
if v, ok := InspectWorkload(w.workload, append(PodSpec(w.GetKind()), "serviceAccountName")...); ok && v != nil {
return v.(string)
}
return ""
}
func (w *Workload) GetPodSpec() (*corev1.PodSpec, error) {
podSpec := &corev1.PodSpec{}
podSepcRaw, _ := InspectWorkload(w.workload, PodSpec(w.GetKind())...)
if podSepcRaw == nil {
return podSpec, fmt.Errorf("no PodSpec for workload: %v", w)
}
b, err := json.Marshal(podSepcRaw)
if err != nil {
return podSpec, err
}
err = json.Unmarshal(b, podSpec)
return podSpec, err
}
func (w *Workload) GetImagePullSecret() ([]corev1.LocalObjectReference, error) {
imgPullSecrets := []corev1.LocalObjectReference{}
iImgPullSecrets, _ := InspectWorkload(w.workload, append(PodSpec(w.GetKind()), "imagePullSecrets")...)
b, err := json.Marshal(iImgPullSecrets)
if err != nil {
return imgPullSecrets, err
}
err = json.Unmarshal(b, &imgPullSecrets)
return imgPullSecrets, err
}
// GetContainers -
func (w *Workload) GetContainers() ([]corev1.Container, error) {
containers := []corev1.Container{}
interContainers, _ := InspectWorkload(w.workload, append(PodSpec(w.GetKind()), "containers")...)
if interContainers == nil {
return containers, nil
}
containersBytes, err := json.Marshal(interContainers)
if err != nil {
return containers, err
}
err = json.Unmarshal(containersBytes, &containers)
return containers, err
}
// GetContainers -
func (w *Workload) GetInitContainers() ([]corev1.Container, error) {
containers := []corev1.Container{}
interContainers, _ := InspectWorkload(w.workload, append(PodSpec(w.GetKind()), "initContainers")...)
if interContainers == nil {
return containers, nil
}
containersBytes, err := json.Marshal(interContainers)
if err != nil {
return containers, err
}
err = json.Unmarshal(containersBytes, &containers)
return containers, err
}
// GetOwnerReferences -
func (w *Workload) GetOwnerReferences() ([]metav1.OwnerReference, error) {
ownerReferences := []metav1.OwnerReference{}
interOwnerReferences, ok := InspectWorkload(w.workload, "metadata", "ownerReferences")
if !ok {
return ownerReferences, nil
}
ownerReferencesBytes, err := json.Marshal(interOwnerReferences)
if err != nil {
return ownerReferences, err
}
err = json.Unmarshal(ownerReferencesBytes, &ownerReferences)
if err != nil {
return ownerReferences, err
}
return ownerReferences, nil
}
func (w *Workload) GetResourceVersion() string {
if v, ok := InspectWorkload(w.workload, "metadata", "resourceVersion"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetUID() string {
if v, ok := InspectWorkload(w.workload, "metadata", "uid"); ok {
return v.(string)
}
return ""
}
func (w *Workload) GetWlid() string {
if wlid, ok := w.GetAnnotation(cautils.ArmoWlid); ok {
return wlid
}
return ""
}
func (w *Workload) GetJobID() *apis.JobTracking {
jobTracking := apis.JobTracking{}
if job, ok := w.GetPodAnnotation(cautils.ArmoJobIDPath); ok {
jobTracking.JobID = job
}
if parent, ok := w.GetPodAnnotation(cautils.ArmoJobParentPath); ok {
jobTracking.ParentID = parent
}
if action, ok := w.GetPodAnnotation(cautils.ArmoJobActionPath); ok {
if i, err := strconv.Atoi(action); err == nil {
jobTracking.LastActionNumber = i
}
}
if jobTracking.LastActionNumber == 0 { // start the counter at 1
jobTracking.LastActionNumber = 1
}
return &jobTracking
}
// func (w *Workload) GetJobID() string {
// if status, ok := w.GetAnnotation(cautils.ArmoJobID); ok {
// return status
// }
// return ""
// }
// ========================================= IS =========================================
func (w *Workload) IsInject() bool {
return w.IsAttached()
}
func (w *Workload) IsIgnore() bool {
if attach := cautils.IsAttached(w.GetPodLabels()); attach != nil {
return !(*attach)
}
if attach := cautils.IsAttached(w.GetLabels()); attach != nil {
return !(*attach)
}
return false
}
func (w *Workload) IsCompatible() bool {
if c, ok := w.GetPodAnnotation(cautils.ArmoCompatibleAnnotation); ok {
return cautils.StringToBool(c)
}
if c, ok := w.GetAnnotation(cautils.ArmoCompatibleAnnotation); ok {
return cautils.StringToBool(c)
}
return false
}
func (w *Workload) IsIncompatible() bool {
if c, ok := w.GetPodAnnotation(cautils.ArmoCompatibleAnnotation); ok {
return !cautils.StringToBool(c)
}
if c, ok := w.GetAnnotation(cautils.ArmoCompatibleAnnotation); ok {
return !cautils.StringToBool(c)
}
return false
}
func (w *Workload) IsAttached() bool {
if attach := cautils.IsAttached(w.GetPodLabels()); attach != nil {
return *attach
}
if attach := cautils.IsAttached(w.GetLabels()); attach != nil {
return *attach
}
return false
}
func (w *Workload) IsReplaceheaders() bool {
if c, ok := w.GetPodAnnotation(cautils.ArmoReplaceheaders); ok {
return cautils.StringToBool(c)
}
return false
}
// ======================================= UTILS =========================================
// InspectWorkload -
func InspectWorkload(workload interface{}, scopes ...string) (val interface{}, k bool) {
val, k = nil, false
if len(scopes) == 0 {
if workload != nil {
return workload, true
}
return nil, false
}
if data, ok := workload.(map[string]interface{}); ok {
val, k = InspectWorkload(data[scopes[0]], scopes[1:]...)
}
return val, k
}
// // InspectWorkload -
// func InjectWorkload(workload interface{}, scopes []string, val string) {
// if len(scopes) == 0 {
// }
// if data, ok := workload.(map[string]interface{}); ok {
// InjectWorkload(data[scopes[0]], scopes[1:], val)
// } else {
// }
// }
// InjectWorkload -
// func InjectWorkload(workload interface{}, scopes []string, val string) {
// if len(scopes) == 0 {
// workload = ""
// }
// if data, ok := workload.(map[string]interface{}); ok {
// d := InjectWorkload(data[scopes[0]], scopes[1:], val)
// data[scopes[0]] = d
// return data
// } else {
// }
// }
// func (w *Workload) SetNamespace(ns string) {
// if v, k := w.workload["metadata"]; k {
// if vv, kk := v.(map[string]interface{}); kk {
// vv["namespace"] = ""
// // if v3, k3 := w.workload["namespace"]; k3 {
// // if v4, k4 := v.(map[string]interface{}); kk {
// // }
// // }
// v = vv
// }
// w.workload = v
// }
// // if data, ok := w.workload.(map[string]interface{}); ok {
// // val, k = InspectWorkload(data[scopes[0]], scopes[1:]...)
// // }
// }

View File

@@ -1,155 +0,0 @@
package k8sinterface
import (
"testing"
)
// ========================================= IS =========================================
func TestLabels(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"labels":{"app":"demoservice-server","cyberarmor.inject":"true"},"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
if workload.GetKind() != "Deployment" {
t.Errorf("wrong kind")
}
if workload.GetNamespace() != "default" {
t.Errorf("wrong namespace")
}
if workload.GetName() != "demoservice-server" {
t.Errorf("wrong name")
}
if !workload.IsInject() {
t.Errorf("expect to find inject label")
}
if workload.IsIgnore() {
t.Errorf("expect to find ignore label")
}
}
func TestSetNamespace(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"demoservice-server"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"demoservice-server"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
workload.SetNamespace("default")
if workload.GetNamespace() != "default" {
t.Errorf("wrong namespace")
}
}
func TestSetLabels(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
workload.SetLabel("bla", "daa")
v, ok := workload.GetLabel("bla")
if !ok || v != "daa" {
t.Errorf("expect to find label")
}
workload.RemoveLabel("bla")
v2, ok2 := workload.GetLabel("bla")
if ok2 || v2 == "daa" {
t.Errorf("label not deleted")
}
}
func TestSetAnnotations(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
workload.SetAnnotation("bla", "daa")
v, ok := workload.GetAnnotation("bla")
if !ok || v != "daa" {
t.Errorf("expect to find annotation")
}
workload.RemoveAnnotation("bla")
v2, ok2 := workload.GetAnnotation("bla")
if ok2 || v2 == "daa" {
t.Errorf("annotation not deleted")
}
}
func TestSetPodLabels(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
workload.SetPodLabel("bla", "daa")
v, ok := workload.GetPodLabel("bla")
if !ok || v != "daa" {
t.Errorf("expect to find label")
}
workload.RemovePodLabel("bla")
v2, ok2 := workload.GetPodLabel("bla")
if ok2 || v2 == "daa" {
t.Errorf("label not deleted")
}
}
func TestRemoveArmo(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server", "armo.attach": "true"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
if !workload.IsAttached() {
t.Errorf("expect to be attached")
}
workload.RemoveArmoMetadata()
if workload.IsAttached() {
t.Errorf("expect to be clear")
}
}
func TestSetWlid(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
workload.SetWlid("wlid://bla")
// t.Errorf(workload.Json())
}
func TestGetResourceVersion(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
if workload.GetResourceVersion() != "1016043" {
t.Errorf("wrong resourceVersion")
}
}
func TestGetUID(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"1"},"creationTimestamp":"2021-05-03T13:10:32Z","generation":1,"managedFields":[{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:app":{},"f:cyberarmor.inject":{}}},"f:spec":{"f:progressDeadlineSeconds":{},"f:replicas":{},"f:revisionHistoryLimit":{},"f:selector":{},"f:strategy":{"f:rollingUpdate":{".":{},"f:maxSurge":{},"f:maxUnavailable":{}},"f:type":{}},"f:template":{"f:metadata":{"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"demoservice\"}":{".":{},"f:env":{".":{},"k:{\"name\":\"ARMO_TEST_NAME\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"CAA_ENABLE_CRASH_REPORTER\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"DEMO_FOLDERS\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SERVER_PORT\"}":{".":{},"f:name":{},"f:value":{}},"k:{\"name\":\"SLEEP_DURATION\"}":{".":{},"f:name":{},"f:value":{}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8089,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}},"manager":"OpenAPI-Generator","operation":"Update","time":"2021-05-03T13:10:32Z"},{"apiVersion":"apps/v1","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:deployment.kubernetes.io/revision":{}}},"f:status":{"f:availableReplicas":{},"f:conditions":{".":{},"k:{\"type\":\"Available\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Progressing\"}":{".":{},"f:lastTransitionTime":{},"f:lastUpdateTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:observedGeneration":{},"f:readyReplicas":{},"f:replicas":{},"f:updatedReplicas":{}}},"manager":"kube-controller-manager","operation":"Update","time":"2021-05-03T13:52:58Z"}],"name":"demoservice-server","namespace":"default","resourceVersion":"1016043","uid":"e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"demoservice-server"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"demoservice-server"}},"spec":{"containers":[{"env":[{"name":"SERVER_PORT","value":"8089"},{"name":"SLEEP_DURATION","value":"1"},{"name":"DEMO_FOLDERS","value":"/app"},{"name":"ARMO_TEST_NAME","value":"auto_attach_deployment"},{"name":"CAA_ENABLE_CRASH_REPORTER","value":"1"}],"image":"quay.io/armosec/demoservice:v25","imagePullPolicy":"IfNotPresent","name":"demoservice","ports":[{"containerPort":8089,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":30}}},"status":{"availableReplicas":1,"conditions":[{"lastTransitionTime":"2021-05-03T13:10:32Z","lastUpdateTime":"2021-05-03T13:10:37Z","message":"ReplicaSet \"demoservice-server-7d478b6998\" has successfully progressed.","reason":"NewReplicaSetAvailable","status":"True","type":"Progressing"},{"lastTransitionTime":"2021-05-03T13:52:58Z","lastUpdateTime":"2021-05-03T13:52:58Z","message":"Deployment has minimum availability.","reason":"MinimumReplicasAvailable","status":"True","type":"Available"}],"observedGeneration":1,"readyReplicas":1,"replicas":1,"updatedReplicas":1}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
if workload.GetUID() != "e9e8a3e9-6cb4-4301-ace1-2c0cef3bd61e" {
t.Errorf("wrong UID")
}
}
func TestIsAttached(t *testing.T) {
w := `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"deployment.kubernetes.io/revision":"3"},"creationTimestamp":"2021-06-21T04:52:05Z","generation":3,"name":"emailservice","namespace":"default"},"spec":{"progressDeadlineSeconds":600,"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"emailservice"}},"strategy":{"rollingUpdate":{"maxSurge":"25%","maxUnavailable":"25%"},"type":"RollingUpdate"},"template":{"metadata":{"annotations":{"armo.last-update":"21-06-2021 06:40:42","armo.wlid":"wlid://cluster-david-demo/namespace-default/deployment-emailservice"},"creationTimestamp":null,"labels":{"app":"emailservice","armo.attach":"true"}},"spec":{"containers":[{"env":[{"name":"PORT","value":"8080"},{"name":"DISABLE_PROFILER","value":"1"}],"image":"gcr.io/google-samples/microservices-demo/emailservice:v0.2.3","imagePullPolicy":"IfNotPresent","livenessProbe":{"exec":{"command":["/bin/grpc_health_probe","-addr=:8080"]},"failureThreshold":3,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":1},"name":"server","ports":[{"containerPort":8080,"protocol":"TCP"}],"readinessProbe":{"exec":{"command":["/bin/grpc_health_probe","-addr=:8080"]},"failureThreshold":3,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":1},"resources":{"limits":{"cpu":"200m","memory":"128Mi"},"requests":{"cpu":"100m","memory":"64Mi"}},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","restartPolicy":"Always","schedulerName":"default-scheduler","securityContext":{},"serviceAccount":"default","serviceAccountName":"default","terminationGracePeriodSeconds":5}}}}`
workload, err := NewWorkload([]byte(w))
if err != nil {
t.Errorf(err.Error())
}
if !workload.IsAttached() {
t.Errorf("expected attached")
}
}

View File

@@ -1,23 +0,0 @@
package k8sinterface
func PodSpec(kind string) []string {
switch kind {
case "Pod", "Namespace":
return []string{"spec"}
case "CronJob":
return []string{"spec", "jobTemplate", "spec", "template", "spec"}
default:
return []string{"spec", "template", "spec"}
}
}
func PodMetadata(kind string) []string {
switch kind {
case "Pod", "Namespace", "Secret":
return []string{"metadata"}
case "CronJob":
return []string{"spec", "jobTemplate", "spec", "template", "metadata"}
default:
return []string{"spec", "template", "metadata"}
}
}

View File

@@ -1,7 +0,0 @@
package opapolicy
const (
PostureRestAPIPathV1 = "/v1/posture"
PostureRedisPrefix = "_postureReportv1"
K8sPostureNotification = "/k8srestapi/v1/newPostureReport"
)

View File

@@ -1,150 +0,0 @@
package opapolicy
import (
"time"
armotypes "kube-escape/cautils/armotypes"
)
type AlertScore float32
type RuleLanguages string
const (
RegoLanguage RuleLanguages = "Rego"
RegoLanguage2 RuleLanguages = "rego"
)
// RegoResponse the expected response of single run of rego policy
type RuleResponse struct {
AlertMessage string `json:"alertMessage"`
PackageName string `json:"packagename"`
AlertScore AlertScore `json:"alertScore"`
// AlertObject AlertObject `json:"alertObject"`
AlertObject AlertObject `json:"alertObject"` // TODO - replace interface to AlertObject
Context []string `json:"context"` // TODO - Remove
Rulename string `json:"rulename"` // TODO - Remove
ExceptionName string `json:"exceptionName"`
}
type AlertObject struct {
K8SApiObjects []map[string]interface{} `json:"k8sApiObjects,omitempty"`
ExternalObjects []map[string]interface{} `json:"externalObjects,omitempty"`
}
type FrameworkReport struct {
Name string `json:"name"`
ControlReports []ControlReport `json:"controlReports"`
}
type ControlReport struct {
Name string `json:"name"`
RuleReports []RuleReport `json:"ruleReports"`
Remediation string `json:"remediation"`
Description string `json:"description"`
}
type RuleReport struct {
Name string `json:"name"`
Remediation string `json:"remediation"`
RuleStatus RuleStatus `json:"ruleStatus"`
RuleResponses []RuleResponse `json:"ruleResponses"`
NumOfResources int
}
type RuleStatus struct {
Status string `json:"status"`
Message string `json:"message"`
}
// PostureReport
type PostureReport struct {
CustomerGUID string `json:"customerGUID"`
ClusterName string `json:"clusterName"`
ReportID string `json:"reportID"`
JobID string `json:"jobID"`
ReportGenerationTime time.Time `json:"generationTime"`
FrameworkReports []FrameworkReport `json:"frameworks"`
}
// RuleMatchObjects defines which objects this rule applied on
type RuleMatchObjects struct {
APIGroups []string `json:"apiGroups"` // apps
APIVersions []string `json:"apiVersions"` // v1/ v1beta1 / *
Resources []string `json:"resources"` // dep.., pods,
}
// RuleMatchObjects defines which objects this rule applied on
type RuleDependency struct {
PackageName string `json:"packageName"` // package name
}
// PolicyRule represents single rule, the fundamental executable block of policy
type PolicyRule struct {
armotypes.PortalBase `json:",inline"`
CreationTime string `json:"creationTime"`
Rule string `json:"rule"` // multiline string!
RuleLanguage RuleLanguages `json:"ruleLanguage"`
Match []RuleMatchObjects `json:"match"`
RuleDependencies []RuleDependency `json:"ruleDependencies"`
Description string `json:"description"`
Remediation string `json:"remediation"`
RuleQuery string `json:"ruleQuery"` // default "armo_builtins" - DEPRECATED
}
// Control represents a collection of rules which are combined together to single purpose
type Control struct {
armotypes.PortalBase `json:",inline"`
CreationTime string `json:"creationTime"`
Description string `json:"description"`
Remediation string `json:"remediation"`
Rules []PolicyRule `json:"rules"`
// for new list of rules in POST/UPADTE requests
RulesIDs *[]string `json:"rulesIDs,omitempty"`
}
type UpdatedControl struct {
Control `json:",inline"`
Rules []interface{} `json:"rules"`
}
// Framework represents a collection of controls which are combined together to expose comprehensive behavior
type Framework struct {
armotypes.PortalBase `json:",inline"`
CreationTime string `json:"creationTime"`
Description string `json:"description"`
Controls []Control `json:"controls"`
// for new list of controls in POST/UPADTE requests
ControlsIDs *[]string `json:"controlsIDs,omitempty"`
}
type UpdatedFramework struct {
Framework `json:",inline"`
Controls []interface{} `json:"controls"`
}
type NotificationPolicyType string
type NotificationPolicyKind string
// Supported NotificationTypes
const (
TypeValidateRules NotificationPolicyType = "validateRules"
TypeExecPostureScan NotificationPolicyType = "execPostureScan"
TypeUpdateRules NotificationPolicyType = "updateRules"
)
// Supported NotificationKinds
const (
KindFramework NotificationPolicyKind = "Framework"
KindControl NotificationPolicyKind = "Control"
KindRule NotificationPolicyKind = "Rule"
)
type PolicyNotification struct {
NotificationType NotificationPolicyType `json:"notificationType"`
Rules []PolicyIdentifier `json:"rules"`
ReportID string `json:"reportID"`
JobID string `json:"jobID"`
Designators armotypes.PortalDesignator `json:"designators"`
}
type PolicyIdentifier struct {
Kind NotificationPolicyKind `json:"kind"`
Name string `json:"name"`
}

View File

@@ -1,300 +0,0 @@
package opapolicy
import (
"time"
armotypes "kube-escape/cautils/armotypes"
)
// Mock A
var (
AMockCustomerGUID = "5d817063-096f-4d91-b39b-8665240080af"
AMockJobID = "36b6f9e1-3b63-4628-994d-cbe16f81e9c7"
AMockReportID = "2c31e4da-c6fe-440d-9b8a-785b80c8576a"
AMockClusterName = "clusterA"
AMockFrameworkName = "testFrameworkA"
AMockControlName = "testControlA"
AMockRuleName = "testRuleA"
AMockPortalBase = *armotypes.MockPortalBase(AMockCustomerGUID, "", nil)
)
func MockRuleResponseA() *RuleResponse {
return &RuleResponse{
AlertMessage: "test alert message A",
AlertScore: 0,
Rulename: AMockRuleName,
PackageName: "test.package.name.A",
Context: []string{},
}
}
func MockFrameworkReportA() *FrameworkReport {
return &FrameworkReport{
Name: AMockFrameworkName,
ControlReports: []ControlReport{
{
Name: AMockControlName,
RuleReports: []RuleReport{
{
Name: AMockRuleName,
Remediation: "remove privilegedContainer: True flag from your pod spec",
RuleResponses: []RuleResponse{
*MockRuleResponseA(),
},
},
},
},
},
}
}
func MockPostureReportA() *PostureReport {
return &PostureReport{
CustomerGUID: AMockCustomerGUID,
ClusterName: AMockClusterName,
ReportID: AMockReportID,
JobID: AMockJobID,
ReportGenerationTime: time.Now().UTC(),
FrameworkReports: []FrameworkReport{*MockFrameworkReportA()},
}
}
func MockFrameworkA() *Framework {
return &Framework{
PortalBase: *armotypes.MockPortalBase("aaaaaaaa-096f-4d91-b39b-8665240080af", AMockFrameworkName, nil),
CreationTime: "",
Description: "mock framework descryption",
Controls: []Control{
{
PortalBase: *armotypes.MockPortalBase("aaaaaaaa-aaaa-4d91-b39b-8665240080af", AMockControlName, nil),
Rules: []PolicyRule{
*MockRuleA(),
},
},
},
}
}
func MockRuleUntrustedRegistries() *PolicyRule {
return &PolicyRule{
PortalBase: *armotypes.MockPortalBase("aaaaaaaa-aaaa-aaaa-b39b-8665240080af", AMockControlName, nil),
Rule: `
package armo_builtins
# Check for images from blacklisted repos
untrusted_registries(z) = x {
x := ["015253967648.dkr.ecr.eu-central-1.amazonaws.com/"]
}
public_registries(z) = y{
y := ["quay.io/kiali/","quay.io/datawire/","quay.io/keycloak/","quay.io/bitnami/"]
}
untrustedImageRepo[msga] {
pod := input[_]
k := pod.kind
k == "Pod"
container := pod.spec.containers[_]
image := container.image
repo_prefix := untrusted_registries(image)[_]
startswith(image, repo_prefix)
selfLink := pod.metadata.selfLink
containerName := container.name
msga := {
"alertMessage": sprintf("image '%v' in container '%s' in [%s] comes from untrusted registry", [image, containerName, selfLink]),
"alert": true,
"prevent": false,
"alertScore": 2,
"alertObject": [{"pod":pod}]
}
}
untrustedImageRepo[msga] {
pod := input[_]
k := pod.kind
k == "Pod"
container := pod.spec.containers[_]
image := container.image
repo_prefix := public_registries(image)[_]
startswith(pod, repo_prefix)
selfLink := input.metadata.selfLink
containerName := container.name
msga := {
"alertMessage": sprintf("image '%v' in container '%s' in [%s] comes from public registry", [image, containerName, selfLink]),
"alert": true,
"prevent": false,
"alertScore": 1,
"alertObject": [{"pod":pod}]
}
}
`,
RuleLanguage: RegoLanguage,
Match: []RuleMatchObjects{
{
APIVersions: []string{"v1"},
APIGroups: []string{"*"},
Resources: []string{"pods"},
},
},
RuleDependencies: []RuleDependency{
{
PackageName: "kubernetes.api.client",
},
},
}
}
func MockRuleA() *PolicyRule {
return &PolicyRule{
PortalBase: *armotypes.MockPortalBase("aaaaaaaa-aaaa-aaaa-b39b-8665240080af", AMockControlName, nil),
Rule: MockRegoPrivilegedPods(), //
RuleLanguage: RegoLanguage,
Match: []RuleMatchObjects{
{
APIVersions: []string{"v1"},
APIGroups: []string{"*"},
Resources: []string{"pods"},
},
},
RuleDependencies: []RuleDependency{
{
PackageName: "kubernetes.api.client",
},
},
}
}
func MockRuleB() *PolicyRule {
return &PolicyRule{
PortalBase: *armotypes.MockPortalBase("bbbbbbbb-aaaa-aaaa-b39b-8665240080af", AMockControlName, nil),
Rule: MockExternalFacingService(), //
RuleLanguage: RegoLanguage,
Match: []RuleMatchObjects{
{
APIVersions: []string{"v1"},
APIGroups: []string{""},
Resources: []string{"pods"},
},
},
RuleDependencies: []RuleDependency{
{
PackageName: "kubernetes.api.client",
},
},
}
}
func MockPolicyNotificationA() *PolicyNotification {
return &PolicyNotification{
NotificationType: TypeExecPostureScan,
ReportID: AMockReportID,
JobID: AMockJobID,
Designators: armotypes.PortalDesignator{},
Rules: []PolicyIdentifier{
{
Kind: KindFramework,
Name: AMockFrameworkName,
}},
}
}
func MockTemp() string {
return `
package armo_builtins
import data.kubernetes.api.client as client
deny[msga] {
#object := input[_]
object := client.query_all("pods")
obj := object.body.items[_]
msga := {
"packagename": "armo_builtins",
"alertMessage": "found object",
"alertScore": 3,
"alertObject": {"object": obj},
}
}
`
}
func MockRegoPrivilegedPods() string {
return `package armo_builtins
import data.kubernetes.api.client as client
# Deny mutating action unless user is in group owning the resource
#privileged pods
deny[msga] {
pod := input[_]
containers := pod.spec.containers[_]
containers.securityContext.privileged == true
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("the following pods are defined as privileged: %v", [pod]),
"alertScore": 3,
"alertObject": pod,
}
}
#handles majority of workload resources
deny[msga] {
wl := input[_]
spec_template_spec_patterns := {"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job"}
spec_template_spec_patterns[wl.kind]
containers := wl.spec.template.spec.containers[_]
containers.securityContext.privileged == true
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("the following workloads are defined as privileged: %v", [wl]),
"alertScore": 3,
"alertObject": wl,
}
}
#handles cronjob
deny[msga] {
wl := input[_]
wl.kind == "CronJob"
containers := wl.spec.jobTemplate.spec.template.spec.containers[_]
containers.securityContext.privileged == true
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("the following cronjobs are defined as privileged: %v", [wl]),
"alertScore": 3,
"alertObject": wl,
}
}
`
}
func MockExternalFacingService() string {
return "\n\tpackage armo_builtins\n\n\timport data.kubernetes.api.client as client\n\timport data.cautils as cautils\n\ndeny[msga] {\n\n\twl := input[_]\n\tcluster_resource := client.query_all(\n\t\t\"services\"\n\t)\n\n\tlabels := wl.metadata.labels\n\tfiltered_labels := json.remove(labels, [\"pod-template-hash\"])\n \n#service := cluster_resource.body.items[i]\nservices := [svc | cluster_resource.body.items[i].metadata.namespace == wl.metadata.namespace; svc := cluster_resource.body.items[i]]\nservice := services[_]\nnp_or_lb := {\"NodePort\", \"LoadBalancer\"}\nnp_or_lb[service.spec.type]\ncautils.is_subobject(service.spec.selector,filtered_labels)\n\n msga := {\n\t\t\"alertMessage\": sprintf(\"%v pod %v expose external facing service: %v\",[wl.metadata.namespace, wl.metadata.name, service.metadata.name]),\n\t\t\"alertScore\": 2,\n\t\t\"packagename\": \"armo_builtins\",\n\t\t\"alertObject\": {\"srvc\":service}\n\t}\n}\n\t"
}
func GetRuntimePods() string {
return `
package armo_builtins
import data.kubernetes.api.client as client
deny[msga] {
cluster_resource := client.query_all(
"pods"
)
pod := cluster_resource.body.items[i]
msga := {
"alertMessage": "got something",
"alertScore": 2,
"packagename": "armo_builtins",
"alertObject": {"pod": pod}
}
}
`
}

View File

@@ -1,42 +0,0 @@
package opapolicy
import (
"encoding/json"
"testing"
)
func TestMockPolicyNotificationA(t *testing.T) {
policy := MockPolicyNotificationA()
bp, err := json.Marshal(policy)
if err != nil {
t.Error(err)
} else {
t.Logf("%s\n", string(bp))
// t.Errorf("%s\n", string(bp))
}
}
func TestMockFrameworkA(t *testing.T) {
policy := MockFrameworkA()
bp, err := json.Marshal(policy)
if err != nil {
t.Error(err)
} else {
t.Logf("%s\n", string(bp))
// t.Errorf("%s\n", string(bp))
}
}
func TestMockPostureReportA(t *testing.T) {
policy := MockPostureReportA()
bp, err := json.Marshal(policy)
if err != nil {
t.Error(err)
} else {
// t.Errorf("%s\n", string(bp))
t.Logf("%s\n", string(bp))
}
}

View File

@@ -1,89 +0,0 @@
package opapolicy
import (
"bytes"
"encoding/json"
"fmt"
"github.com/golang/glog"
"github.com/open-policy-agent/opa/rego"
)
func (pn *PolicyNotification) ToJSONBytesBuffer() (*bytes.Buffer, error) {
res, err := json.Marshal(pn)
if err != nil {
return nil, err
}
return bytes.NewBuffer(res), err
}
func (ruleReport *RuleReport) GetRuleStatus() (string, []RuleResponse, []RuleResponse) {
if len(ruleReport.RuleResponses) == 0 {
return "success", nil, nil
}
exceptions := make([]RuleResponse, 0)
failed := make([]RuleResponse, 0)
for _, rule := range ruleReport.RuleResponses {
if rule.ExceptionName != "" {
failed = append(failed, rule)
} else {
exceptions = append(exceptions, rule)
}
}
status := "failed"
if len(failed) == 0 && len(exceptions) > 0 {
status = "warning"
}
return status, failed, exceptions
}
func ParseRegoResult(regoResult *rego.ResultSet) ([]RuleResponse, error) {
var errs error
ruleResponses := []RuleResponse{}
for _, result := range *regoResult {
for desicionIdx := range result.Expressions {
if resMap, ok := result.Expressions[desicionIdx].Value.(map[string]interface{}); ok {
for objName := range resMap {
jsonBytes, err := json.Marshal(resMap[objName])
if err != nil {
err = fmt.Errorf("in parseRegoResult, json.Marshal failed. name: %s, obj: %v, reason: %s", objName, resMap[objName], err)
glog.Error(err)
errs = fmt.Errorf("%s\n%s", errs, err)
continue
}
desObj := make([]RuleResponse, 0)
if err := json.Unmarshal(jsonBytes, &desObj); err != nil {
err = fmt.Errorf("in parseRegoResult, json.Unmarshal failed. name: %s, obj: %v, reason: %s", objName, resMap[objName], err)
glog.Error(err)
errs = fmt.Errorf("%s\n%s", errs, err)
continue
}
ruleResponses = append(ruleResponses, desObj...)
}
}
}
}
return ruleResponses, errs
}
func (controlReport *ControlReport) GetNumberOfResources() int {
sum := 0
for i := range controlReport.RuleReports {
sum += controlReport.RuleReports[i].NumOfResources
}
return sum
}
func (controlReport *ControlReport) Passed() bool {
for i := range controlReport.RuleReports {
if len(controlReport.RuleReports[i].RuleResponses) > 0 {
return false
}
}
return true
}
func (controlReport *ControlReport) Failed() bool {
return !controlReport.Passed()
}

View File

@@ -1,47 +0,0 @@
package opapolicy
import (
"github.com/francoispqt/gojay"
"time"
)
/*
responsible on fast unmarshaling of various COMMON containerscan structures and substructures
*/
// UnmarshalJSONObject - File inside a pkg
func (r *PostureReport) UnmarshalJSONObject(dec *gojay.Decoder, key string) (err error) {
switch key {
case "customerGUID":
err = dec.String(&(r.CustomerGUID))
case "clusterName":
err = dec.String(&(r.ClusterName))
case "reportID":
err = dec.String(&(r.ReportID))
case "jobID":
err = dec.String(&(r.JobID))
case "generationTime":
err = dec.Time(&(r.ReportGenerationTime), time.RFC3339)
r.ReportGenerationTime = r.ReportGenerationTime.Local()
}
return err
}
// func (files *PkgFiles) UnmarshalJSONArray(dec *gojay.Decoder) error {
// lae := PackageFile{}
// if err := dec.Object(&lae); err != nil {
// return err
// }
// *files = append(*files, lae)
// return nil
// }
func (file *PostureReport) NKeys() int {
return 0
}
//------------------------

View File

@@ -1,204 +0,0 @@
package resources
var RegoCAUtils = `
package cautils
list_contains(lista,element) {
some i
lista[i] == element
}
# getPodName(metadata) = name {
# name := metadata.generateName
#}
getPodName(metadata) = name {
name := metadata.name
}
#returns subobject ,sub1 is partial to parent, e.g parent = {a:a,b:b,c:c,d:d}
# sub1 = {b:b,c:c} - result is {b:b,c:c}, if sub1={b:b,e:f} returns {b:b}
object_intersection(parent,sub1) = r{
r := {k:p | p := sub1[k]
parent[k]== p
}
}
#returns if parent contains sub(both are objects not sets!!)
is_subobject(sub,parent) {
object_intersection(sub,parent) == sub
}
`
var RegoDesignators = `
package designators
import data.cautils
#functions that related to designators
#allowed_namespace
#@input@: receive as part of the input object "included_namespaces" list
#@input@: item's namespace as "namespace"
#returns true if namespace exists in that list
included_namespaces(namespace){
cautils.list_contains(["default"],namespace)
}
#forbidden_namespaces
#@input@: receive as part of the input object "forbidden_namespaces" list
#@input@: item's namespace as "namespace"
#returns true if namespace exists in that list
excluded_namespaces(namespace){
not cautils.list_contains(["excluded"],namespace)
}
forbidden_wlids(wlid){
input.forbidden_wlids[_] == wlid
}
filter_k8s_object(obj) = filtered {
#put
filtered := obj
#filtered := [ x | cautils.list_contains(["default"],obj[i].metadata.namespace) ; x := obj[i] ]
# filtered := [ x | not cautils.list_contains([],filter1Set[i].metadata.namespace); x := filter1Set[i]]
}
`
var RegoKubernetesApiClient = `
package kubernetes.api.client
# service account token
token := data.k8sconfig.token
# Cluster host
host := data.k8sconfig.host
# default certificate path
# crt_file := "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
crt_file := data.k8sconfig.crtfile
client_crt_file := data.k8sconfig.clientcrtfile
client_key_file := data.k8sconfig.clientkeyfile
# This information could be retrieved from the kubernetes API
# too, but would essentially require a request per API group,
# so for now use a lookup table for the most common resources.
resource_group_mapping := {
"services": "api/v1",
"pods": "api/v1",
"configmaps": "api/v1",
"secrets": "api/v1",
"persistentvolumeclaims": "api/v1",
"daemonsets": "apis/apps/v1",
"deployments": "apis/apps/v1",
"statefulsets": "apis/apps/v1",
"horizontalpodautoscalers": "api/autoscaling/v1",
"jobs": "apis/batch/v1",
"cronjobs": "apis/batch/v1beta1",
"ingresses": "api/extensions/v1beta1",
"replicasets": "apis/apps/v1",
"networkpolicies": "apis/networking.k8s.io/v1",
"clusterroles": "apis/rbac.authorization.k8s.io/v1",
"clusterrolebindings": "apis/rbac.authorization.k8s.io/v1",
"roles": "apis/rbac.authorization.k8s.io/v1",
"rolebindings": "apis/rbac.authorization.k8s.io/v1",
"serviceaccounts": "api/v1"
}
# Query for given resource/name in provided namespace
# Example: query_ns("deployments", "my-app", "default")
query_name_ns(resource, name, namespace) = http.send({
"url": sprintf("%v/%v/namespaces/%v/%v/%v", [
host,
resource_group_mapping[resource],
namespace,
resource,
name,
]),
"method": "get",
"headers": {"authorization": token},
"tls_client_cert_file": client_crt_file,
"tls_client_key_file": client_key_file,
"tls_ca_cert_file": crt_file,
"raise_error": true,
})
# Query for given resource type using label selectors
# https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api
# Example: query_label_selector_ns("deployments", {"app": "opa-kubernetes-api-client"}, "default")
query_label_selector_ns(resource, selector, namespace) = http.send({
"url": sprintf("%v/%v/namespaces/%v/%v?labelSelector=%v", [
host,
resource_group_mapping[resource],
namespace,
resource,
label_map_to_query_string(selector),
]),
"method": "get",
"headers": {"authorization": token},
"tls_client_cert_file": client_crt_file,
"tls_client_key_file": client_key_file,
"tls_ca_cert_file": crt_file,
"raise_error": true,
})
# x := field_transform_to_qry_param("spec.selector",input)
# input = {"app": "acmefit", "service": "catalog-db"}
# result: "spec.selector.app%3Dacmefit,spec.selector.service%3Dcatalog-db"
query_field_selector_ns(resource, field, selector, namespace) = http.send({
"url": sprintf("%v/%v/namespaces/%v/%v?fieldSelector=%v", [
host,
resource_group_mapping[resource],
namespace,
resource,
field_transform_to_qry_param(field,selector),
]),
"method": "get",
"headers": {"authorization": token},
"tls_client_cert_file": client_crt_file,
"tls_client_key_file": client_key_file,
"tls_ca_cert_file": crt_file,
"raise_error": true,
})
# # Query for all resources of type resource in all namespaces
# # Example: query_all("deployments")
# query_all(resource) = http.send({
# "url": sprintf("https://%v:%v/%v/%v", [
# ip,
# port,
# resource_group_mapping[resource],
# resource,
# ]),
# "method": "get",
# "headers": {"authorization": sprintf("Bearer %v", [token])},
# "tls_client_cert_file": crt_file,
# "raise_error": true,
# })
# Query for all resources of type resource in all namespaces
# Example: query_all("deployments")
query_all(resource) = http.send({
"url": sprintf("%v/%v/%v", [
host,
resource_group_mapping[resource],
resource,
]),
"method": "get",
"headers": {"authorization": token},
"tls_client_cert_file": client_crt_file,
"tls_client_key_file": client_key_file,
"tls_ca_cert_file": crt_file,
"raise_error": true,
})
field_transform_to_qry_param(field,map) = finala {
mid := {concat(".",[field,key]): val | val := map[key]}
finala := label_map_to_query_string(mid)
}
label_map_to_query_string(map) = concat(",", [str | val := map[key]; str := concat("%3D", [key, val])])
`

View File

@@ -1,20 +0,0 @@
package armo_builtins
# import data.kubernetes.api.client as client
import data.cautils as cautils
# alert cronjobs
#handles cronjob
deny[msga] {
wl := input[_]
wl.kind == "CronJob"
msga := {
"alertMessage": sprintf("the following cronjobs are defined: %v", [wl]),
"alertScore": 2,
"packagename": "armo_builtins",
"alertObject": wl
}
}

View File

@@ -1,44 +0,0 @@
package armo_builtins
import data.kubernetes.api.client as client
# input: pod
# apiversion: v1
# does:
# returns the external facing services of that pod
#
#
deny[msga] {
pod := input[_]
podns := pod.metadata.namespace
podname := getName(pod.metadata)
# pod := client.query_name_ns("pods","frontend-86c5ffb485-kfp9d", "default")
labels := pod.body.metadata.labels
filtered_labels := json.remove(labels, ["pod-template-hash"])
cluster_resource := client.query_all(
"services"
)
services := [svc | cluster_resource.body.items[i].metadata.namespace == podns; svc := cluster_resource.body.items[i]]
service := services[_]
np_or_lb := {"NodePort", "LoadBalancer"}
np_or_lb[service.spec.type]
service.spec.selector == filtered_labels
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("pod %v/%v exposed services: %v\n", [podns,podname,service]),
"alertScore": 7,
"alertObject": {"service":service,"labels":filtered_labels, "podname":podname,"namespace":podns}
}
}
getName(metadata) = name {
name := metadata.generateName
}
getName(metadata) = name {
name := metadata.name
}

View File

@@ -1,57 +0,0 @@
package armo_builtins
#import data.kubernetes.api.client as client
import data.cautils as cautils
# input: pod
# apiversion: v1
# does:
# returns hostPath volumes
#
#
deny[msga] {
pod := input[_]
pod.kind == "Pod"
volumes := pod.spec.volumes
volume := volumes[_]
# crsrcs.body.spec.containers[_].volumeMounts[_].name = volume.name
volume.hostPath
podname := cautils.getPodName(pod.metadata)
obj := {"volume":volume,"podname": podname}
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("pod: %v has {%v,%v} ashostPath volume \n\n\n", [podname, volume]),
"alertScore": 7,
"alertObject": [obj]
}
}
isRWMount(mount) {
not mount.readOnly
}
isRWMount(mount) {
mount.readOnly == false
}
#handles majority of workload resources
deny[msga] {
wl := input[_]
spec_template_spec_patterns := {"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job"}
spec_template_spec_patterns[wl.kind]
volumes := wl.spec.template.spec.volumes
volume := volumes[_]
volume.hostPath
wlname := cautils.getPodName(wl.metadata)
obj := {"volume":volume,"podname": wlname}
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("%v: %v has {%v,%v} as hostPath volume\n\n\n", [wl.kind,wlname, volume]),
"alertScore": 7,
"alertObject": [obj]
}
}

View File

@@ -1,56 +0,0 @@
package armo_builtins
#import data.kubernetes.api.client as client
# Deny mutating action unless user is in group owning the resource
#privileged pods
deny[msga] {
pod := input[_]
containers := pod.spec.containers[_]
containers.securityContext.privileged == true
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("the following pods are defined as privileged: %v", [pod]),
"alertScore": 3,
"alertObject": pod,
}
}
#handles majority of workload resources
deny[msga] {
wl := input[_]
spec_template_spec_patterns := {"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job"}
spec_template_spec_patterns[wl.kind]
containers := wl.spec.template.spec.containers[_]
containers.securityContext.privileged == true
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("the following workloads are defined as privileged: %v", [wl]),
"alertScore": 3,
"alertObject": wl,
}
}
#handles cronjob
deny[msga] {
wl := input[_]
wl.kind == "CronJob"
containers := wl.spec.jobTemplate.spec.template.spec.containers[_]
containers.securityContext.privileged == true
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("the following cronjobs are defined as privileged: %v", [wl]),
"alertScore": 3,
"alertObject": wl,
}
}

View File

@@ -1,98 +0,0 @@
package armo_builtins
import data.kubernetes.api.client as client
import data.cautils as cautils
# input: None
# apiversion: v1
# does:
# returns roles+ related subjects in rolebinding
deny[msga] {
# rsrc := client.query_all("roles")
# role := rsrc.body.items[_]
role := input[_]
role.kind == "Role"
rule := role.rules[_]
cautils.list_contains(rule.resources,"secrets")
canViewSecrets(rule)
rbsrc := client.query_all("rolebindings")
rolebinding := rbsrc.body.items[_]
rolebinding.roleRef.kind == "Role"
rolebinding.roleRef.name == role.metadata.name
msga := {
"alertMessage": sprintf("the following users: %v , got read secret access roles", [rolebinding.subjects]),
"alertScore": 9,
"packagename": "armo_builtins",
"alertObject": {"role":role,"users":rolebinding.subjects}
}
}
# input: None
# apiversion: v1
# does:
# returns clusterroles+ related subjects in rolebinding
deny[msga] {
# rsrc := client.query_all("clusterroles")
# role := rsrc.body.items[_]
role := input[_]
role.kind == "ClusterRole"
rule := role.rules[_]
cautils.list_contains(rule.resources,"secrets")
canViewSecrets(rule)
rbsrc := client.query_all("rolebindings")
rolebinding := rbsrc.body.items[_]
rolebinding.roleRef.kind == "ClusterRole"
rolebinding.roleRef.name == role.metadata.name
msga := {
"alertMessage": sprintf("the following users: %v , got read secret access roles", [rolebinding.subjects]),
"alertScore": 9,
"packagename": "armo_builtins",
"alertObject": {"clusterrole":role,"users":rolebinding.subjects}
}
}
# input: None
# apiversion: v1
# does:
# returns clusterroles+ related subjects in clusterrolebinding
#
#
deny[msga] {
# rsrc := client.query_all("clusterroles")
# role := rsrc.body.items[_]
role := input[_]
role.kind == "ClusterRole"
rule := role.rules[_]
cautils.list_contains(rule.resources,"secrets")
canViewSecrets(rule)
rbsrc := client.query_all("clusterrolebindings")
rolebinding := rbsrc.body.items[_]
rolebinding.roleRef.kind == "ClusterRole"
rolebinding.roleRef.name == role.metadata.name
msga := {
"alertMessage": sprintf("the following users: %v , got read secret access roles", [rolebinding.subjects]),
"alertScore": 9,
"packagename": "armo_builtins",
"alertObject": {"clusterrole":role,"users":rolebinding.subjects}
}
}
canViewSecrets(rule) {
cautils.list_contains(rule.verbs,"get")
}
canViewSecrets(rule) {
cautils.list_contains(rule.verbs,"watch")
}

View File

@@ -1,64 +0,0 @@
package armo_builtins
#import data.kubernetes.api.client as client
import data.cautils as cautils
# input: pod
# apiversion: v1
# does:
# returns rw hostpath volumes of that pod
#
#
deny[msga] {
pod := input[_]
pod.kind == "Pod"
volumes := pod.spec.volumes
volume := volumes[_]
# crsrcs.body.spec.containers[_].volumeMounts[_].name = volume.name
mount := pod.spec.containers[_].volumeMounts[_]
mount.name == volume.name
volume.hostPath
isRWMount(mount)
podname := cautils.getPodName(pod.metadata)
obj := {"volume":volume,"mount":mount,"podname": podname}
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("pod: %v has {%v,%v} as rw hostPath volume and volumemount pair\n\n\n", [podname, volume,mount]),
"alertScore": 7,
"alertObject": [obj],
}
}
isRWMount(mount) {
not mount.readOnly
}
isRWMount(mount) {
mount.readOnly == false
}
#handles majority of workload resources
deny[msga] {
wl := input[_]
spec_template_spec_patterns := {"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job"}
spec_template_spec_patterns[wl.kind]
volumes := wl.spec.template.spec.volumes
volume := volumes[_]
mount := wl.spec.template.spec.containers[_].volumeMounts[_]
mount.name == volume.name
volume.hostPath
isRWMount(mount)
wlname := cautils.getPodName(wl.metadata)
obj := {"volume":volume,"mount":mount,"podname": wlname}
msga := {
"packagename": "armo_builtins",
"alertMessage": sprintf("%v: %v has {%v,%v} as rw hostPath volume and volumemount pair\n\n\n", [wl.kind,wlname, volume,mount]),
"alertScore": 7,
"alertObject": [obj],
}
}

View File

@@ -1,57 +0,0 @@
package armo_builtins
import data.kubernetes.api.client as client
import data.cautils as cautils
# input: pod
# apiversion: v1
# does:
# returns the external facing services of that pod
#
#
deny[msga] {
pod := input[_]
podns := pod.metadata.namespace
podname := cautils.getPodName(pod.metadata)
# pod := client.query_name_ns("pods", "catalog-mongo-6f468d99b4-pn242", "default")
labels := pod.body.metadata.labels
filtered_labels := json.remove(labels, ["pod-template-hash"])
cluster_resource := client.query_all(
"services"
)
services := [svc | cluster_resource.body.items[i].metadata.namespace == podns; svc := cluster_resource.body.items[i]]
service := services[_]
service.spec.selector == filtered_labels
hasSSHPorts(service)
msga := {
"alertMessage": sprintf("pod %v/%v exposed by SSH services: %v\n", [podns,podname,service]),
"packagename": "armo_builtins",
"alertScore": 7,
"alertObject": [{"pod":pod,"service":{service}}]
}
}
hasSSHPorts(service) {
port := service.spec.ports[_]
port.port == 22
}
hasSSHPorts(service) {
port := service.spec.ports[_]
port.port == 2222
}
hasSSHPorts(service) {
port := service.spec.ports[_]
port.targetPort == 22
}
hasSSHPorts(service) {
port := service.spec.ports[_]
port.targetPort == 2222
}

View File

@@ -1,33 +0,0 @@
{
"guid": "3b0467c9-488d-c244-99d0-90fbf600aaff",
"name": "[Builtin] rule-deny-access-to-secrets",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "determines which users can get/list/watch secrets",
"attributes": {
"m$K8sThreatMatrix": "Credential Access::List k8s Secrets"
},
"ruleDependencies": [
{
"packageName":"cautils"
},
{
"packageName":"kubernetes.api.client"
}
],
"remediation": "",
"match": [
{
"resources": [
"Role","ClusterRole"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"rbac.authorization.k8s.io"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\nimport data.kubernetes.api.client as client\nimport data.cautils as cautils\n\n\n# input: None\n# apiversion: v1\n# does: \n#\treturns roles+ related subjects in rolebinding\n\n\ndeny[msga] {\n\t# rsrc := client.query_all(\"roles\")\n\t# role := rsrc.body.items[_]\n\trole := input[_]\n\trole.kind == \"Role\"\n\trule := role.rules[_]\n\tcautils.list_contains(rule.resources,\"secrets\")\n\tcanViewSecrets(rule)\n\trbsrc := client.query_all(\"rolebindings\")\n\trolebinding := rbsrc.body.items[_]\n\trolebinding.roleRef.kind == \"Role\"\n\trolebinding.roleRef.name == role.metadata.name\n\t\n \n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"the following users: %v , got read secret access roles\", [rolebinding.subjects]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 9,\n\t\t\"alertObject\": {\"role\":role,\"users\":rolebinding.subjects}\n\t\n\t}\n}\n\n\n\n# input: None\n# apiversion: v1\n# does: \n#\treturns clusterroles+ related subjects in rolebinding\n\n\ndeny[msga] {\n\t# rsrc := client.query_all(\"clusterroles\")\n\t# role := rsrc.body.items[_]\n\trole := input[_]\n\trole.kind == \"ClusterRole\"\n\trule := role.rules[_]\n\tcautils.list_contains(rule.resources,\"secrets\")\n\tcanViewSecrets(rule)\n\trbsrc := client.query_all(\"rolebindings\")\n\trolebinding := rbsrc.body.items[_]\n\trolebinding.roleRef.kind == \"ClusterRole\"\n\trolebinding.roleRef.name == role.metadata.name\n\t\n \n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"the following users: %v , got read secret access roles\", [rolebinding.subjects]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 9,\n\t\t\"alertObject\": {\"clusterrole\":role,\"users\":rolebinding.subjects}\n\t\n\t}\n}\n\n\n# input: None\n# apiversion: v1\n# does: \n#\treturns clusterroles+ related subjects in clusterrolebinding\n#\n#\ndeny[msga] {\n\t# rsrc := client.query_all(\"clusterroles\")\n\t# role := rsrc.body.items[_]\n\trole := input[_]\n\trole.kind == \"ClusterRole\"\n\trule := role.rules[_]\n\tcautils.list_contains(rule.resources,\"secrets\")\n\tcanViewSecrets(rule)\n\trbsrc := client.query_all(\"clusterrolebindings\")\n\trolebinding := rbsrc.body.items[_]\n\trolebinding.roleRef.kind == \"ClusterRole\"\n\trolebinding.roleRef.name == role.metadata.name\n\t\n \n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"the following users: %v , got read secret access roles\", [rolebinding.subjects]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 9,\n\t\t\"alertObject\": {\"clusterrole\":role,\"users\":rolebinding.subjects}\n\t\n\t}\n}\n\ncanViewSecrets(rule) {\n\tcautils.list_contains(rule.verbs,\"get\")\n}\ncanViewSecrets(rule) {\n\tcautils.list_contains(rule.verbs,\"watch\")\n}\n"
}

View File

@@ -1,34 +0,0 @@
{
"guid": "3b0467c9-488d-c244-99d0-90fbf600aaff",
"name": "[Builtin] rule-can-ssh-to-pod",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "denies pods with SSH ports opened(22/222)",
"attributes": {
"microsoftK8sThreatMatrix": "val1"
},
"ruleDependencies": [
{
"packageName":"cautils"
},
{
"packageName":"kubernetes.api.client"
}
],
"remediation": "create a network policy that protects SSH ports",
"match": [
{
"resources": [
"Pods"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"*"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\nimport data.kubernetes.api.client as client\nimport data.cautils as cautils\n\n# input: pod\n# apiversion: v1\n# does: \n#\treturns the external facing services of that pod\n#\n#\ndeny[msga] {\n\tpod := input[_]\n\tpodns := pod.metadata.namespace\n\tpodname := cautils.getPodName(pod.metadata)\n\t# pod := client.query_name_ns(\"pods\", \"catalog-mongo-6f468d99b4-pn242\", \"default\")\n\tlabels := pod.body.metadata.labels\n\tfiltered_labels := json.remove(labels, [\"pod-template-hash\"])\n \n\t cluster_resource := client.query_all(\n\t \t\"services\"\n\t )\n\n\tservices := [svc | cluster_resource.body.items[i].metadata.namespace == podns; svc := cluster_resource.body.items[i]]\n\tservice := \tservices[_]\n\tservice.spec.selector == filtered_labels\n \n\thasSSHPorts(service)\n\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"pod %v/%v exposed by SSH services: %v\n\", [podns,podname,service]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 7,\n\t\t\"alertObject\": [{\"pod\":pod,\"service\":{service}}]\n\t\n\t}\n}\n\nhasSSHPorts(service) {\n\tport := service.spec.ports[_]\n\tport.port == 22\n}\n\n\nhasSSHPorts(service) {\n\tport := service.spec.ports[_]\n\tport.port == 2222\n}\n\nhasSSHPorts(service) {\n\tport := service.spec.ports[_]\n\tport.targetPort == 22\n}\n\n\nhasSSHPorts(service) {\n\tport := service.spec.ports[_]\n\tport.targetPort == 2222\n}\n"
}

View File

@@ -1,33 +0,0 @@
{
"guid": "",
"name": "[Builtin] rule-identify-blacklisted-image-registries",
"creationTime": "",
"description": "Identifying if pod container images are from unallowed registries",
"attributes": {
"m$K8sThreatMatrix": "Initial Access::Compromised images in registry"
},
"ruleDependencies": [
{
"packageName": "cautils"
},
{
"packageName": "kubernetes.api.client"
}
],
"remediation": "Use images from safe registry",
"match": [
{
"resources": [
"Pods"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"*"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\n# Check for images from blacklisted repos\n\nuntrusted_registries(z) = x {\n\tx := [\"015253967648.dkr.ecr.eu-central-1.amazonaws.com/\"]\t\n}\n\npublic_registries(z) = y{\n\ty := [\"quay.io/kiali/\",\"quay.io/datawire/\",\"quay.io/keycloak/\",\"quay.io/bitnami/\"]\n}\n\nuntrustedImageRepo[msga] {\n\tpod := input[_]\n\tk := pod.kind\n\tk == \"Pod\"\n\tcontainer := pod.spec.containers[_]\n\timage := container.image\n repo_prefix := untrusted_registries(image)[_]\n\tstartswith(image, repo_prefix)\n\tselfLink := pod.metadata.selfLink\n\tcontainerName := container.name\n\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"image '%v' in container '%s' in [%s] comes from untrusted registry\", [image, containerName, selfLink]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 2,\n\t\t\"alertObject\": [{\"pod\":pod}]\n\t}\n}\n\nuntrustedImageRepo[msga] {\n pod := input[_]\n\tk := pod.kind\n\tk == \"Pod\"\n\tcontainer := pod.spec.containers[_]\n\timage := container.image\n repo_prefix := public_registries(image)[_]\n\tstartswith(pod, repo_prefix)\n\tselfLink := input.metadata.selfLink\n\tcontainerName := container.name\n\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"image '%v' in container '%s' in [%s] comes from public registry\", [image, containerName, selfLink]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 1,\n\t\t\"alertObject\": [{\"pod\":pod}]\n\t}\n}"
}

View File

@@ -1,31 +0,0 @@
{
"guid": "3b0467c9-488d-c244-99d0-90fbf600aaff",
"name": "[Builtin] rule-pod-external-facing",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "denies pods with external facing services, grabs related services",
"attributes": {
"microsoftK8sThreatMatrix": "val1"
},
"ruleDependencies": [
{
"packageName":"kubernetes.api.client"
}
],
"remediation": "create a network policy that controls which protect your cluster from unwanted connections and the outside world",
"match": [
{
"resources": [
"Pods"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"*"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\n\nimport data.kubernetes.api.client as client\n\n\n# input: pod\n# apiversion: v1\n# does: \n#\treturns the external facing services of that pod\n#\n#\ndeny[msga] {\n\tpod := input[_]\n\tpodns := pod.metadata.namespace\n\tpodname := getName(pod.metadata)\n\t# pod := client.query_name_ns(\"pods\",\"frontend-86c5ffb485-kfp9d\", \"default\")\n\tlabels := pod.body.metadata.labels\n\tfiltered_labels := json.remove(labels, [\"pod-template-hash\"])\n \n\t cluster_resource := client.query_all(\n\t \t\"services\"\n\t )\n\n\n\tservices := [svc | cluster_resource.body.items[i].metadata.namespace == podns; svc := cluster_resource.body.items[i]]\n\tservice := \tservices[_]\n\tnp_or_lb := {\"NodePort\", \"LoadBalancer\"}\n\tnp_or_lb[service.spec.type]\n\tservice.spec.selector == filtered_labels\n \n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"pod %v/%v exposed services: %v\n\", [podns,podname,service]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 7,\n\t\t\"alertObject\": {\"service\":service,\"labels\":filtered_labels, \"podname\":podname,\"namespace\":podns}\n\t\n\t}\n}\n\ngetName(metadata) = name {\n\tname := metadata.generateName\n}\ngetName(metadata) = name {\n\tname := metadata.name\n}\n"
}

View File

@@ -1,31 +0,0 @@
{
"guid": "3b0467c9-488d-c244-99d0-90fbf600aaff",
"name": "[Builtin] alert-any-hostpath",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "determines if any workload contains a hostPath volume",
"attributes": {
"m$K8sThreatMatrix": "Privilege Escalation::hostPath mount"
},
"ruleDependencies": [
{
"packageName":"cautils"
}
],
"remediation": "consider if hostPath is really necessary - reading sensitive data like hostPath credentials might endanger cluster, if so consider encrypting the data",
"match": [
{
"resources": [
"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job","Pod"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"*"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\nimport data.kubernetes.api.client as client\nimport data.cautils as cautils\n\n# input: pod\n# apiversion: v1\n# does: \n#\treturns hostPath volumes\n#\n#\ndeny[msga] {\n pod := input[_]\n pod.kind == \"Pod\"\n volumes := pod.spec.volumes\n volume := volumes[_]\n # crsrcs.body.spec.containers[_].volumeMounts[_].name = volume.name\n volume.hostPath\n podname := cautils.getPodName(pod.metadata)\n obj := {\"volume\":volume,\"podname\": podname}\n\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"pod: %v has {%v,%v} ashostPath volume \n\n\n\", [podname, volume]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 7,\n\t\t\"alertObject\": [obj],\n\t\n\t}\n}\n\nisRWMount(mount) {\n not mount.readOnly\n}\nisRWMount(mount) {\n mount.readOnly == false\n}\n\n\n#handles majority of workload resources\ndeny[msga] {\n\n\twl := input[_]\n\tspec_template_spec_patterns := {\"Deployment\",\"ReplicaSet\",\"DaemonSet\",\"StatefulSet\",\"Job\"}\n\tspec_template_spec_patterns[wl.kind]\n volumes := wl.spec.template.spec.volumes\n volume := volumes[_]\n volume.hostPath\n wlname := cautils.getPodName(wl.metadata)\n obj := {\"volume\":volume,\"podname\": wlname}\n\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"%v: %v has {%v,%v} as hostPath volume\n\n\n\", [wl.kind,wlname, volume]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 7,\n\t\t\"alertObject\": [obj],\n\t\n\t}\n}\n\n\n"
}

View File

@@ -1,27 +0,0 @@
{
"guid": "82f19070-2826-4fe4-a079-f5f7e7a1b04d",
"name": "[Builtin] instance-metadata-api-access",
"attributes": {
"m$K8sThreatMatrix": "Credential Access::Instance Metadata API"
},
"creationTime": "2021-04-25T10:48:48.861806",
"rule": "package armo_builtins\n# Check for images from blacklisted repos\n\nmetadata_azure(z) = http.send({\n\t\"url\": \"http://169.254.169.254/metadata/instance?api-version=2020-09-01\",\n\t\"method\": \"get\",\n\t\"headers\": {\"Metadata\": \"true\"},\n\t\"raise_error\": true,\t\n})\n\nmetadata_gcp(z) = http.send({\n\t\"url\": \"http://169.254.169.254/computeMetadata/v1/?alt=json&recursive=true\",\n\t\"method\": \"get\",\n\t\"headers\": {\"Metadata-Flavor\": \"Google\"},\n\t\"raise_error\": true,\t\n})\n\nmetadata_aws(z) = metadata_object { \n\thostname := http.send({\n\t\"url\": \"http://169.254.169.254/latest/meta-data/local-hostname\",\n\t\"method\": \"get\",\n\t\"raise_error\": true,\t\n })\n\tmetadata_object := {\n\t\t\"raw_body\": hostname.raw_body,\n\t\t\"hostname\" : hostname.raw_body,\n\t\t\"status_code\" : hostname.status_code\n\t}\n}\n\nazure_metadata[msga] {\t\n\tmetadata_object := metadata_azure(\"aaa\")\n\tmetadata_object.status_code == 200\n\tnode_name := metadata_object.body.compute.name\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"Node '%s' has access to Instance Metadata Services of Azure.\", [node_name]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 1,\n\t\t\"alertObject\": [{\"nodeMetadata\":metadata_object.body}]\n\t}\n}\n\ngcp_metadata[msga] {\t\n\tmetadata_object := metadata_gcp(\"aaa\")\n\tmetadata_object.status_code == 200\n\tnode_name := metadata_object.body.instance.hostname\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"Node '%s' has access to Instance Metadata Services of GCP.\", [node_name]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 1,\n\t\t\"alertObject\": [{\"nodeMetadata\": metadata_object.raw_body}]\n\t}\n}\n\naws_metadata[msga] {\t\n\tmetadata_object := metadata_aws(\"aaa\")\n\tmetadata_object.status_code == 200\n\tnode_name := metadata_object.hostname\n\tmsga := {\n\t\t\"alertMessage\": sprintf(\"Node '%s' has access to Instance Metadata Services of AWS.\", [node_name]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 1,\n\t\t\"alertObject\": [{\"nodeMetadata\": metadata_object.raw_body}]\n\t}\n}",
"ruleLanguage": "Rego",
"match": [
{
"apiGroups": [
"*"
],
"apiVersions": [
"*"
],
"resources": [
"nodes"
]
}
],
"ruleDependencies": [],
"description": "Checks if there is access from the nodes to cloud prividers instance metadata services",
"remediation": "From https://attack.mitre.org/techniques/T1552/005/ :Option A: Disable or Remove Feature or Program, Option B: Filter Network Traffic",
"ruleQuery": ""
}

View File

@@ -1,30 +0,0 @@
{
"guid": "[Builtin] 3b0467c9-488d-c244-99d0-90fbf600aaff",
"name": "rule-deny-cronjobs",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "determines if it's cronjob",
"attributes": {
"m$K8sThreatMatrix": "Persistence::Cronjob"
},
"ruleDependencies": [
{
"packageName":"cautils"
}
],
"remediation": "",
"match": [
{
"resources": [
"CronJob"
],
"apiVersions": [
"v1beta1"
],
"apiGroups": [
"batch"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\n\n# import data.kubernetes.api.client as client\nimport data.cautils as cautils\n\n\n# alert cronjobs\n\n#handles cronjob\ndeny[msga] {\n\n\twl := input[_]\n\twl.kind == \"CronJob\"\n msga := {\n\t\t\"alertMessage\": sprintf(\"the following cronjobs are defined: %v\", [wl]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 2,\n\t\t\"alertObject\": wl\n\t\n\t}\n}\n"
}

View File

@@ -1,29 +0,0 @@
{
"guid": "",
"name": "[Builtin] rule-privilege-escalation",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "determines if pods/deployments defined as privileged true",
"attributes": {
"mitre": "Privilege Escalation",
"mitreCode": "TA0004",
"m$K8sThreatMatrix": "Privilege Escalation::privileged container"
},
"ruleDependencies": [
],
"remediation": "avoid defining pods as privilleged",
"match": [
{
"resources": [
"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job","Pod","CronJob"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"*"
]
}
],
"ruleLanguage": "Rego",
"rule": "\npackage armo_builtins\n\nimport data.kubernetes.api.client as client\nimport data.designators as scope\nimport data.cautils as cautils\n\n\n# Deny mutating action unless user is in group owning the resource\n\n\n#privileged pods\ndeny[msga] {\n\n \n\tpod := input[_]\n\tcontainers := pod.spec.containers[_]\n\tcontainers.securityContext.privileged == true\n msga := {\n\t\t\"alertMessage\": sprintf(\"the following pods are defined as privileged: %v\", [pod]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 3,\n\t\t\"alertObject\": pod,\n\t\n\t}\n}\n\n\n#handles majority of workload resources\ndeny[msga] {\n\n\twl := input[_]\n\tspec_template_spec_patterns := {\"Deployment\",\"ReplicaSet\",\"DaemonSet\",\"StatefulSet\",\"Job\"}\n\tspec_template_spec_patterns[wl.kind]\n\tcontainers := wl.spec.template.spec.containers[_]\n\tcontainers.securityContext.privileged == true\n msga := {\n\t\t\"alertMessage\": sprintf(\"the following workloads are defined as privileged: %v\", [wl]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 3,\n\t\t\"alertObject\": wl,\n\t\n\t}\n}\n\n\n\n#handles cronjob\ndeny[msga] {\n\n\twl := input[_]\n\twl.kind == \"CronJob\"\n\tcontainers := wl.spec.jobTemplate.spec.template.spec.containers[_]\n\tcontainers.securityContext.privileged == true\n msga := {\n\t\t\"alertMessage\": sprintf(\"the following cronjobs are defined as privileged: %v\", [wl]),\n\t\t\"alert\": true,\n\t\t\"prevent\": false,\n\t\t\"alertScore\": 3,\n\t\t\"alertObject\": wl,\n\t\n\t}\n}\n\n"
}

View File

@@ -1,31 +0,0 @@
{
"guid": "3b0467c9-488d-c244-99d0-90fbf600aaff",
"name": "[Builtin] alert-rw-hostpath",
"creationTime": "2019-09-04T12:04:58.461455",
"description": "determines if any workload contains a hostPath volume with rw permissions",
"attributes": {
"m$K8sThreatMatrix": "Persistance::Writable hostPath mount"
},
"ruleDependencies": [
{
"packageName":"cautils"
}
],
"remediation": "consider if hostPath is really necessary- sensitive data like hostPath credentials might endanger cluster, if so consider encrypting the data",
"match": [
{
"resources": [
"Deployment","ReplicaSet","DaemonSet","StatefulSet","Job","Pod"
],
"apiVersions": [
"v1"
],
"apiGroups": [
"*"
]
}
],
"ruleLanguage": "Rego",
"rule": "\"\\npackage armo_builtins\\nimport data.kubernetes.api.client as client\\nimport data.cautils as cautils\\n\\n# input: pod\\n# apiversion: v1\\n# does: \\n#\\treturns hostPath volumes\\n#\\n#\\ndeny[msga] {\\n pod := input[_]\\n pod.kind == \\\"Pod\\\"\\n volumes := pod.spec.volumes\\n volume := volumes[_]\\n # crsrcs.body.spec.containers[_].volumeMounts[_].name = volume.name\\n volume.hostPath\\n podname := cautils.getPodName(pod.metadata)\\n obj := {\\\"volume\\\":volume,\\\"podname\\\": podname}\\n\\n\\tmsga := {\\n\\t\\t\\\"alertMessage\\\": sprintf(\\\"pod: %v has {%v,%v} ashostPath volume \\n\\n\\n\\\", [podname, volume]),\\n\\t\\t\\\"alert\\\": true,\\n\\t\\t\\\"prevent\\\": false,\\n\\t\\t\\\"alertScore\\\": 7,\\n\\t\\t\\\"alertObject\\\": [obj],\\n\\t\\n\\t}\\n}\\n\\nisRWMount(mount) {\\n not mount.readOnly\\n}\\nisRWMount(mount) {\\n mount.readOnly == false\\n}\\n\\n\\n#handles majority of workload resources\\ndeny[msga] {\\n\\n\\twl := input[_]\\n\\tspec_template_spec_patterns := {\\\"Deployment\\\",\\\"ReplicaSet\\\",\\\"DaemonSet\\\",\\\"StatefulSet\\\",\\\"Job\\\"}\\n\\tspec_template_spec_patterns[wl.kind]\\n volumes := wl.spec.template.spec.volumes\\n volume := volumes[_]\\n volume.hostPath\\n wlname := cautils.getPodName(wl.metadata)\\n obj := {\\\"volume\\\":volume,\\\"podname\\\": wlname}\\n\\n\\tmsga := {\\n\\t\\t\\\"alertMessage\\\": sprintf(\\\"%v: %v has {%v,%v} as hostPath volume\\n\\n\\n\\\", [wl.kind,wlname, volume]),\\n\\t\\t\\\"alert\\\": true,\\n\\t\\t\\\"prevent\\\": false,\\n\\t\\t\\\"alertScore\\\": 7,\\n\\t\\t\\\"alertObject\\\": [obj],\\n\\t\\n\\t}\\n}\\n\\n\\n\""
}

View File

@@ -1,126 +0,0 @@
package resources
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"kube-escape/cautils/k8sinterface"
"github.com/golang/glog"
"github.com/open-policy-agent/opa/storage"
"github.com/open-policy-agent/opa/storage/inmem"
"github.com/open-policy-agent/opa/util"
"k8s.io/client-go/rest"
)
var (
RegoDependenciesPath = "/resources/rego/dependencies"
)
type RegoDependenciesData struct {
K8sConfig RegoK8sConfig `json:"k8sconfig"`
}
type RegoK8sConfig struct {
Token string `json:"token"`
IP string `json:"ip"`
Host string `json:"host"`
Port string `json:"port"`
CrtFile string `json:"crtfile"`
ClientCrtFile string `json:"clientcrtfile"`
ClientKeyFile string `json:"clientkeyfile"`
// ClientKeyFile string `json:"crtfile"`
}
func NewRegoDependenciesDataMock() *RegoDependenciesData {
return NewRegoDependenciesData(k8sinterface.GetK8sConfig())
}
func NewRegoDependenciesData(k8sConfig *rest.Config) *RegoDependenciesData {
regoDependenciesData := RegoDependenciesData{
K8sConfig: *NewRegoK8sConfig(k8sConfig),
}
return &regoDependenciesData
}
func NewRegoK8sConfig(k8sConfig *rest.Config) *RegoK8sConfig {
host := k8sConfig.Host
if host == "" {
ip := os.Getenv("KUBERNETES_SERVICE_HOST")
port := os.Getenv("KUBERNETES_SERVICE_PORT")
host = fmt.Sprintf("https://%s:%s", ip, port)
}
token := ""
if k8sConfig.BearerToken != "" {
token = fmt.Sprintf("Bearer %s", k8sConfig.BearerToken)
}
// crtFile := os.Getenv("KUBERNETES_CRT_PATH")
// if crtFile == "" {
// crtFile = k8sConfig.CAFile
// // crtFile = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
// }
// glog.Infof("===========================================================================")
// glog.Infof(fmt.Sprintf("%v", k8sConfig.String()))
// glog.Infof("===========================================================================")
regoK8sConfig := RegoK8sConfig{
Token: token,
Host: k8sConfig.Host,
CrtFile: k8sConfig.CAFile,
ClientCrtFile: k8sConfig.CertFile,
ClientKeyFile: k8sConfig.KeyFile,
}
return &regoK8sConfig
}
func (data *RegoDependenciesData) TOStorage() (storage.Store, error) {
var jsonObj map[string]interface{}
bytesData, err := json.Marshal(*data)
if err != nil {
return nil, err
}
// glog.Infof("RegoDependenciesData: %s", bytesData)
if err := util.UnmarshalJSON(bytesData, &jsonObj); err != nil {
return nil, err
}
return inmem.NewFromObject(jsonObj), nil
}
// LoadRegoDependenciesFromDir loads the policies list from *.rego file in given directory
func LoadRegoFiles(dir string) map[string]string {
modules := make(map[string]string)
// Compile the module. The keys are used as identifiers in error messages.
filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if err == nil && strings.HasSuffix(path, ".rego") && !info.IsDir() {
content, err := ioutil.ReadFile(path)
if err != nil {
glog.Errorf("LoadRegoFiles, Failed to load: %s: %v", path, err)
} else {
modules[strings.Trim(filepath.Base(path), ".rego")] = string(content)
}
}
return nil
})
return modules
}
// LoadRegoModules loads the policies from variables
func LoadRegoModules() map[string]string {
modules := make(map[string]string)
modules["cautils"] = RegoCAUtils
modules["designators"] = RegoDesignators
modules["kubernetes.api.client"] = RegoKubernetesApiClient
return modules
}

View File

@@ -1,17 +0,0 @@
package resources
import (
"os"
"path/filepath"
"testing"
)
func TestLoadRegoDependenciesFromDir(t *testing.T) {
dir, _ := os.Getwd()
t.Errorf("%s", filepath.Join(dir, "rego/dependencies"))
return
// modules := LoadRegoDependenciesFromDir("")
// if len(modules) == 0 {
// t.Errorf("modules len == 0")
// }
}

View File

@@ -1,5 +0,0 @@
package cautils
const (
ComponentIdentifier = "Posture"
)

View File

@@ -1,44 +0,0 @@
package cautils
import (
"fmt"
"strings"
)
const ValueNotFound = -1
func ConvertLabelsToString(labels map[string]string) string {
labelsStr := ""
delimiter := ""
for k, v := range labels {
labelsStr += fmt.Sprintf("%s%s=%s", delimiter, k, v)
delimiter = ";"
}
return labelsStr
}
// ConvertStringToLabels convert a string "a=b;c=d" to map: {"a":"b", "c":"d"}
func ConvertStringToLabels(labelsStr string) map[string]string {
labels := make(map[string]string)
labelsSlice := strings.Split(labelsStr, ";")
if len(labelsSlice)%2 != 0 {
return labels
}
for i := range labelsSlice {
kvSlice := strings.Split(labelsSlice[i], "=")
if len(kvSlice) != 2 {
continue
}
labels[kvSlice[0]] = kvSlice[1]
}
return labels
}
func StringInSlice(strSlice []string, str string) int {
for i := range strSlice {
if strSlice[i] == str {
return i
}
}
return ValueNotFound
}

Some files were not shown because too many files have changed in this diff Show More