Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kubescape/storage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.59
Choose a base ref
...
head repository: kubescape/storage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jan 16, 2024

  1. ignore empty field

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jan 16, 2024
    Copy the full SHA
    b5f411b View commit details
  2. update generated objects

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jan 16, 2024
    Copy the full SHA
    45ec641 View commit details
  3. bump k8s package

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jan 16, 2024
    Copy the full SHA
    6009fb0 View commit details

Commits on Jan 17, 2024

  1. support init containers

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jan 17, 2024
    Copy the full SHA
    bfae917 View commit details
  2. Merge branch 'main' into fix/empty-sbom

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil authored Jan 17, 2024
    Copy the full SHA
    bde2fc5 View commit details

Commits on Jan 18, 2024

  1. Merge pull request #91 from kubescape/fix/empty-sbom

    Fix/empty SBOM
    matthyx authored Jan 18, 2024
    Copy the full SHA
    e6cbcde View commit details
  2. optimize memory profile of file storage (#89)

    * disable default profiler, start pprof on port 6060
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * try without duplicating obj in writeFiles
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * avoid reading whole files before unmarshalling
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * avoid marshalling whole files before writing
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * drop the deepcopy from GuaranteedUpdate
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * add benchmark for writeFiles
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * add mergePatch for ApplicationProfile
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    ---------
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx authored Jan 18, 2024
    Copy the full SHA
    48da71b View commit details

Commits on Jan 24, 2024

  1. fix network neighbors save (#92)

    * don't validate spec as it's empty after writeFiles
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * avoid panic with empty port
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    * drop ManagedFields, truncate file on open
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    
    ---------
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx authored Jan 24, 2024
    Copy the full SHA
    b400cbf View commit details

Commits on Jan 26, 2024

  1. Fix/cleanup (#93)

    * fix cleanup
    
    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    
    * Generate NP only when ready
    
    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    
    * Silence klogs
    
    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    
    * fixed units
    
    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    
    * update mock list
    
    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    
    ---------
    
    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil authored Jan 26, 2024
    Copy the full SHA
    5dec0b0 View commit details

Commits on Feb 1, 2024

  1. ignore empty files (#95)

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil authored Feb 1, 2024
    Copy the full SHA
    54e72de View commit details
  2. add mutexes per key for all methods

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Feb 1, 2024
    Copy the full SHA
    7568e88 View commit details

Commits on Feb 5, 2024

  1. add presave processor to deduplicate profile info

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Feb 5, 2024
    Copy the full SHA
    4a89322 View commit details
  2. Merge pull request #94 from kubescape/silence

    add presave processor to deduplicate profile info
    matthyx authored Feb 5, 2024
    Copy the full SHA
    a4538df View commit details

Commits on Feb 6, 2024

  1. read file before deleting it

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Feb 6, 2024
    Copy the full SHA
    dbeb184 View commit details
  2. refactor locks

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Feb 6, 2024
    Copy the full SHA
    721f173 View commit details
  3. Merge pull request #97 from kubescape/errors

    Fix errors in logs
    matthyx authored Feb 6, 2024
    Copy the full SHA
    39de0ad View commit details

Commits on Feb 7, 2024

  1. chore(deps): Bump github.com/opencontainers/runc from 1.1.5 to 1.1.12

    Bumps [github.com/opencontainers/runc](https://github.com/opencontainers/runc) from 1.1.5 to 1.1.12.
    - [Release notes](https://github.com/opencontainers/runc/releases)
    - [Changelog](https://github.com/opencontainers/runc/blob/v1.1.12/CHANGELOG.md)
    - [Commits](opencontainers/runc@v1.1.5...v1.1.12)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/opencontainers/runc
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 7, 2024
    Copy the full SHA
    8717d7d View commit details
  2. Merge pull request #98 from kubescape/dependabot/go_modules/github.co…

    …m/opencontainers/runc-1.1.12
    
    chore(deps): Bump github.com/opencontainers/runc from 1.1.5 to 1.1.12
    matthyx authored Feb 7, 2024
    Copy the full SHA
    7c2d4b9 View commit details

Commits on Feb 20, 2024

  1. prevent race condition on watcher.stopped

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Feb 20, 2024
    Copy the full SHA
    10daaff View commit details

Commits on Feb 21, 2024

  1. Merge pull request #99 from kubescape/panic

    prevent race condition on watcher.stopped
    David Wertenteil authored Feb 21, 2024
    Copy the full SHA
    77bf3fb View commit details

Commits on Mar 5, 2024

  1. refactor locks to prevent race on get list

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Mar 5, 2024
    Copy the full SHA
    52fed34 View commit details
  2. Merge pull request #101 from kubescape/unmarshal

    refactor locks to prevent race on get list
    matthyx authored Mar 5, 2024
    Copy the full SHA
    13cd52e View commit details

Commits on Mar 8, 2024

  1. add size annotation for applicationprofiles

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Mar 8, 2024
    Copy the full SHA
    41dee83 View commit details

Commits on Mar 11, 2024

  1. remove summary objects

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Mar 11, 2024
    Copy the full SHA
    7461b46 View commit details
  2. Merge pull request #96 from kubescape/summary

    remove summary objects
    David Wertenteil authored Mar 11, 2024
    Copy the full SHA
    71986bd View commit details
  3. Merge branch 'main' into 10k

    matthyx authored Mar 11, 2024
    Copy the full SHA
    948e59a View commit details
  4. Merge pull request #102 from kubescape/10k

    add size annotation for applicationprofiles
    matthyx authored Mar 11, 2024
    Copy the full SHA
    adf0ad7 View commit details

Commits on Mar 26, 2024

  1. Revert some types from "remove summary objects"

    This reverts commit 7461b46.
    
    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Mar 26, 2024
    Copy the full SHA
    6bd88c6 View commit details
  2. Merge pull request #104 from kubescape/resum

    Revert some types from "remove summary objects"
    matthyx authored Mar 26, 2024
    Copy the full SHA
    d4a5e23 View commit details

Commits on Apr 4, 2024

  1. status update checks (#105)

    * status update checks
    
    Signed-off-by: Amir Malka <amirm@armosec.io>
    
    * added tests and updated readme
    
    Signed-off-by: Amir Malka <amirm@armosec.io>
    
    * fix test
    
    Signed-off-by: Amir Malka <amirm@armosec.io>
    
    * CR
    
    Signed-off-by: Amir Malka <amirm@armosec.io>
    
    ---------
    
    Signed-off-by: Amir Malka <amirm@armosec.io>
    amirmalka authored Apr 4, 2024
    Copy the full SHA
    c8186a0 View commit details

Commits on Apr 5, 2024

  1. support ephemeral containers (#106)

    Signed-off-by: Amir Malka <amirm@armosec.io>
    amirmalka authored Apr 5, 2024
    Copy the full SHA
    d0ee88d View commit details

Commits on Apr 10, 2024

  1. fix MetadataType in artifacts

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Apr 10, 2024
    Copy the full SHA
    1a921cf View commit details
  2. Merge pull request #108 from kubescape/fix/metadata-type

    Fix MetadataType in artifacts
    David Wertenteil authored Apr 10, 2024
    Copy the full SHA
    74572f3 View commit details
  3. adding artifact (#109)

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil authored Apr 10, 2024
    Copy the full SHA
    181dd25 View commit details

Commits on Apr 12, 2024

  1. add NetworkNeighborhood as a collection of NetworkNeighbors

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Apr 12, 2024
    Copy the full SHA
    82a0123 View commit details

Commits on Apr 14, 2024

  1. Merge pull request #107 from kubescape/nnv2

    add NetworkNeighborhood as a collection of NetworkNeighbors
    David Wertenteil authored Apr 14, 2024
    Copy the full SHA
    69f8392 View commit details

Commits on Apr 17, 2024

  1. reject updates on complete app profile, remove omitempty (#110)

    Signed-off-by: Amir Malka <amirm@armosec.io>
    amirmalka authored Apr 17, 2024
    Copy the full SHA
    aa7229a View commit details

Commits on Apr 29, 2024

  1. bump syft

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Apr 29, 2024
    Copy the full SHA
    30128a0 View commit details

Commits on Apr 30, 2024

  1. Merge pull request #111 from kubescape/bumpsyft

    bump syft
    David Wertenteil authored Apr 30, 2024
    Copy the full SHA
    6957fdd View commit details
  2. add conversion for PackageBasicData from syft 0.101.1

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed Apr 30, 2024
    Copy the full SHA
    577f22b View commit details
  3. Merge pull request #112 from kubescape/bumpsyft

    add conversion for PackageBasicData from syft 0.101.1
    matthyx authored Apr 30, 2024
    Copy the full SHA
    30ed573 View commit details

Commits on May 3, 2024

  1. fix panic in deflateNetworkNeighbors

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed May 3, 2024
    Copy the full SHA
    f76888b View commit details
  2. Merge pull request #113 from kubescape/panic

    fix panic in deflateNetworkNeighbors
    matthyx authored May 3, 2024
    Copy the full SHA
    56ea302 View commit details

Commits on May 14, 2024

  1. use gob instead of json for storage

    Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
    matthyx committed May 14, 2024
    Copy the full SHA
    73387b6 View commit details

Commits on May 15, 2024

  1. Merge pull request #114 from kubescape/gob

    use gob instead of json for storage
    matthyx authored May 15, 2024
    Copy the full SHA
    59ff7f9 View commit details

Commits on May 30, 2024

  1. Adding files

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed May 30, 2024
    Copy the full SHA
    ef5726f View commit details
  2. first test passed

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed May 30, 2024
    Copy the full SHA
    237a5ea View commit details

Commits on Jun 2, 2024

  1. moved to v1

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jun 2, 2024
    Copy the full SHA
    02f8429 View commit details
  2. move np files

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jun 2, 2024
    Copy the full SHA
    0200a3b View commit details

Commits on Jun 4, 2024

  1. adding v2

    Signed-off-by: David Wertenteil <dwertent@armosec.io>
    David Wertenteil committed Jun 4, 2024
    Copy the full SHA
    5b3c27c View commit details
Showing with 69,993 additions and 13,510 deletions.
  1. +3 −0 .dockerignore
  2. +2 −2 .github/workflows/pr-created.yaml
  3. +4 −4 .github/workflows/pr-merged.yaml
  4. +5 −0 ADOPTERS.md
  5. +5 −0 CODE_OF_CONDUCT.md
  6. +5 −0 COMMUNITY.md
  7. +3 −5 CONTRIBUTING.md
  8. +5 −0 GOVERNANCE.md
  9. +4 −2 MAINTAINERS.md
  10. +2 −1 Makefile
  11. +66 −7 README.md
  12. +7 −3 SECURITY-INSIGHTS.yml
  13. +3 −5 SECURITY.md
  14. +0 −1 artifacts/configurationscansummaries/01-example.yaml
  15. +0 −3 artifacts/configurationscansummaries/02-example.yaml
  16. +1 −1 artifacts/configurationscansummaries/03-example.yaml
  17. +1 −1 artifacts/configurationscansummaries/04-example.yaml
  18. +42 −0 artifacts/networkneighborhood/01-example.yaml
  19. +0 −8 artifacts/sbomsummaries/01-example.yaml
  20. +2 −2 build/Dockerfile
  21. +13 −0 build/protoc.Dockerfile
  22. +130 −145 go.mod
  23. +271 −324 go.sum
  24. +30 −23 hack/update-codegen.sh
  25. +13 −0 known-servewr.yaml
  26. +25 −7 main.go
  27. +8 −0 pkg/apis/softwarecomposition/consts/consts.go
  28. +0 −99 pkg/apis/softwarecomposition/fuzzer/fuzzer.go
  29. +6 −5 pkg/apis/softwarecomposition/grype_types.go
  30. +0 −78 pkg/apis/softwarecomposition/install/roundtrip_test.go
  31. +79 −0 pkg/apis/softwarecomposition/knownserversfinder.go
  32. +57 −0 pkg/apis/softwarecomposition/knownserversfinder_test.go
  33. +54 −1 pkg/apis/softwarecomposition/network_types.go
  34. +71 −71 pkg/apis/softwarecomposition/networkpolicy.go
  35. +1 −1 pkg/apis/softwarecomposition/networkpolicy/labels.go
  36. +83 −84 pkg/apis/softwarecomposition/networkpolicy/{ → v1}/networkpolicy.go
  37. +223 −142 pkg/apis/softwarecomposition/networkpolicy/{ → v1}/networkpolicy_test.go
  38. +496 −0 pkg/apis/softwarecomposition/networkpolicy/v2/networkpolicy.go
  39. +1,993 −0 pkg/apis/softwarecomposition/networkpolicy/v2/networkpolicy_test.go
  40. +27 −84 pkg/apis/softwarecomposition/packagemetadata/packagemetadata.go
  41. +10 −8 pkg/apis/softwarecomposition/register.go
  42. +9 −7 pkg/apis/softwarecomposition/scan_types.go
  43. +3 −23 pkg/apis/softwarecomposition/sourcemetadata/sourcemetadata.go
  44. +0 −907 pkg/apis/softwarecomposition/spdx_types.go
  45. +186 −94 pkg/apis/softwarecomposition/syfttypes.go
  46. +50 −0 pkg/apis/softwarecomposition/syfttypes_test.go
  47. +617 −0 pkg/apis/softwarecomposition/testdata/artifact-v01011.json
  48. +620 −0 pkg/apis/softwarecomposition/testdata/artifact.json
  49. +335 −141 pkg/apis/softwarecomposition/types.go
  50. +194 −0 pkg/apis/softwarecomposition/types_test.go
  51. +45,807 −0 pkg/apis/softwarecomposition/v1beta1/generated.pb.go
  52. +1,727 −0 pkg/apis/softwarecomposition/v1beta1/generated.proto
  53. +68 −67 pkg/apis/softwarecomposition/v1beta1/grype_types.go
  54. +65 −28 pkg/apis/softwarecomposition/v1beta1/network_types.go
  55. +15 −15 pkg/apis/softwarecomposition/v1beta1/networkpolicy.go
  56. +3 −7 pkg/apis/softwarecomposition/v1beta1/networkpolicy/{ → v1}/networkpolicy.go
  57. +92 −4 pkg/apis/softwarecomposition/v1beta1/networkpolicy/{ → v1}/networkpolicy_test.go
  58. +55 −0 pkg/apis/softwarecomposition/v1beta1/networkpolicy/v2/networkpolicy.go
  59. +132 −0 pkg/apis/softwarecomposition/v1beta1/networkpolicy/v2/networkpolicy_test.go
  60. +24 −0 pkg/apis/softwarecomposition/v1beta1/networkpolicy/v2/testdata/known-servers.json
  61. +304 −0 pkg/apis/softwarecomposition/v1beta1/networkpolicy/v2/testdata/nn-operator.json
  62. +281 −0 pkg/apis/softwarecomposition/v1beta1/networkpolicy/v2/testdata/np-operator.json
  63. +281 −0 pkg/apis/softwarecomposition/v1beta1/networkpolicy/v2/testdata/np.new.json
  64. +4 −8 pkg/apis/softwarecomposition/v1beta1/register.go
  65. +52 −50 pkg/apis/softwarecomposition/v1beta1/scan_types.go
  66. +0 −928 pkg/apis/softwarecomposition/v1beta1/spdx_types.go
  67. +192 −100 pkg/apis/softwarecomposition/v1beta1/syfttypes.go
  68. +299 −181 pkg/apis/softwarecomposition/v1beta1/types.go
  69. +882 −1,120 pkg/apis/softwarecomposition/v1beta1/zz_generated.conversion.go
  70. +609 −734 pkg/apis/softwarecomposition/v1beta1/zz_generated.deepcopy.go
  71. +0 −179 pkg/apis/softwarecomposition/validation/validation.go
  72. +0 −158 pkg/apis/softwarecomposition/validation/validation_test.go
  73. +609 −734 pkg/apis/softwarecomposition/zz_generated.deepcopy.go
  74. +63 −59 pkg/apiserver/apiserver.go
  75. +0 −74 pkg/apiserver/scheme_test.go
  76. +0 −26 pkg/apiserver/serializer.go
  77. +0 −89 pkg/apiserver/serializer_test.go
  78. +157 −106 pkg/cleanup/cleanup.go
  79. +30 −44 pkg/cleanup/cleanup_test.go
  80. +75 −28 pkg/cleanup/discovery.go
  81. +796 −0 pkg/cleanup/testdata/expectedFilesToDelete.json
  82. +1 −219 pkg/cleanup/testdata/wlids.json
  83. +171 −1 pkg/cleanup/utils.go
  84. +12 −0 pkg/cleanup/utils_test.go
  85. +46 −0 pkg/cmd/server/limiter.go
  86. +101 −6 pkg/cmd/server/start.go
  87. +3 −1 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/applicationprofile.go
  88. +0 −178 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/applicationprofilesummary.go
  89. +0 −129 ...ated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_applicationprofilesummary.go
  90. +129 −0 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_networkneighborhood.go
  91. +0 −141 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_sbomspdxv2p3.go
  92. +0 −141 ...generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_sbomspdxv2p3filtered.go
  93. +0 −141 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_sbomsummary.go
  94. +141 −0 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_seccompprofile.go
  95. +9 −17 ...ted/clientset/versioned/typed/softwarecomposition/v1beta1/fake/fake_softwarecomposition_client.go
  96. +6 −8 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/generated_expansion.go
  97. +178 −0 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/networkneighborhood.go
  98. +0 −195 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/sbomspdxv2p3.go
  99. +0 −195 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/sbomspdxv2p3filtered.go
  100. +0 −195 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/sbomsummary.go
  101. +195 −0 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/seccompprofile.go
  102. +11 −21 pkg/generated/clientset/versioned/typed/softwarecomposition/v1beta1/softwarecomposition_client.go
  103. +4 −8 pkg/generated/informers/externalversions/generic.go
  104. +0 −90 pkg/generated/informers/externalversions/softwarecomposition/v1beta1/applicationprofilesummary.go
  105. +14 −28 pkg/generated/informers/externalversions/softwarecomposition/v1beta1/interface.go
  106. +19 −19 .../informers/externalversions/softwarecomposition/v1beta1/{sbomsummary.go → networkneighborhood.go}
  107. +0 −90 pkg/generated/informers/externalversions/softwarecomposition/v1beta1/sbomspdxv2p3filtered.go
  108. +19 −19 ...ated/informers/externalversions/softwarecomposition/v1beta1/{sbomspdxv2p3.go → seccompprofile.go}
  109. +0 −99 pkg/generated/listers/softwarecomposition/v1beta1/applicationprofilesummary.go
  110. +24 −32 pkg/generated/listers/softwarecomposition/v1beta1/expansion_generated.go
  111. +99 −0 pkg/generated/listers/softwarecomposition/v1beta1/networkneighborhood.go
  112. +0 −99 pkg/generated/listers/softwarecomposition/v1beta1/sbomspdxv2p3.go
  113. +0 −99 pkg/generated/listers/softwarecomposition/v1beta1/sbomspdxv2p3filtered.go
  114. +0 −99 pkg/generated/listers/softwarecomposition/v1beta1/sbomsummary.go
  115. +99 −0 pkg/generated/listers/softwarecomposition/v1beta1/seccompprofile.go
  116. +2,169 −2,577 pkg/generated/openapi/zz_generated.openapi.go
  117. +134 −0 pkg/registry/file/applicationprofile_processor.go
  118. +248 −0 pkg/registry/file/applicationprofile_processor_test.go
  119. +179 −0 pkg/registry/file/callstack/callstack.go
  120. +198 −0 pkg/registry/file/callstack/callstack_benchmark_test.go
  121. +1,479 −0 pkg/registry/file/callstack/callstack_test.go
  122. +62 −0 pkg/registry/file/callstack/helpers.go
  123. +30 −85 pkg/registry/file/configurationscansummarystorage.go
  124. +31 −14 pkg/registry/file/configurationscansummarystorage_test.go
  125. +97 −0 pkg/registry/file/directio.go
  126. +156 −0 pkg/registry/file/dynamicpathdetector/analyze_endpoints.go
  127. +59 −0 pkg/registry/file/dynamicpathdetector/analyze_opens.go
  128. +166 −0 pkg/registry/file/dynamicpathdetector/analyzer.go
  129. +215 −0 pkg/registry/file/dynamicpathdetector/tests/analyze_endpoints_test.go
  130. +152 −0 pkg/registry/file/dynamicpathdetector/tests/analyze_opens_test.go
  131. +149 −0 pkg/registry/file/dynamicpathdetector/tests/benchmark_test.go
  132. +250 −0 pkg/registry/file/dynamicpathdetector/tests/coverage_test.go
  133. +19 −0 pkg/registry/file/dynamicpathdetector/types.go
  134. +16 −0 pkg/registry/file/dynamicpathdetector/utils.go
  135. +31 −74 pkg/registry/file/generatednetworkpolicy.go
  136. +110 −24 pkg/registry/file/generatednetworkpolicy_test.go
  137. +109 −0 pkg/registry/file/networkneighborhood_processor.go
  138. +131 −0 pkg/registry/file/networkneighborhood_processor_test.go
  139. +59 −0 pkg/registry/file/processor.go
  140. +49 −0 pkg/registry/file/processor_test.go
  141. +198 −0 pkg/registry/file/sqlite.go
  142. +111 −0 pkg/registry/file/sqlite_test.go
  143. +460 −321 pkg/registry/file/storage.go
  144. +325 −144 pkg/registry/file/storage_test.go
  145. +8 −51 pkg/registry/file/vulnerabilitysummarystorage.go
  146. +32 −26 pkg/registry/file/vulnerabilitysummarystorage_test.go
  147. +163 −89 pkg/registry/file/watch.go
  148. +157 −264 pkg/registry/file/watch_test.go
  149. +1 −3 pkg/registry/softwarecomposition/applicationactivity/strategy.go
  150. +57 −4 pkg/registry/softwarecomposition/applicationprofile/strategy.go
  151. +264 −0 pkg/registry/softwarecomposition/applicationprofile/strategy_test.go
  152. +0 −56 pkg/registry/softwarecomposition/applicationprofilesummary/etcd.go
  153. +0 −91 pkg/registry/softwarecomposition/applicationprofilesummary/strategy.go
  154. +2 −3 pkg/registry/softwarecomposition/configurationscansummary/strategy.go
  155. +2 −9 pkg/registry/softwarecomposition/generatednetworkpolicy/strategy.go
  156. +2 −9 pkg/registry/softwarecomposition/knownservers/strategy.go
  157. +7 −7 pkg/registry/softwarecomposition/{sbomspdxv2p3filtered → networkneighborhood}/etcd.go
  158. +144 −0 pkg/registry/softwarecomposition/networkneighborhood/strategy.go
  159. +346 −0 pkg/registry/softwarecomposition/networkneighborhood/strategy_test.go
  160. +41 −8 pkg/registry/softwarecomposition/networkneighbors/strategy.go
  161. +90 −0 pkg/registry/softwarecomposition/networkneighbors/strategy_test.go
  162. +1 −3 pkg/registry/softwarecomposition/openvulnerabilityexchange/strategy.go
  163. +0 −105 pkg/registry/softwarecomposition/sbomspdxv2p3/strategy.go
  164. +0 −91 pkg/registry/softwarecomposition/sbomspdxv2p3filtered/strategy.go
  165. +0 −40 pkg/registry/softwarecomposition/sbomsummary/etcd.go
  166. +0 −91 pkg/registry/softwarecomposition/sbomsummary/strategy.go
  167. +1 −2 pkg/registry/softwarecomposition/sbomsyftfiltereds/strategy.go
  168. +1 −2 pkg/registry/softwarecomposition/sbomsyfts/strategy.go
  169. +7 −7 pkg/registry/softwarecomposition/{sbomspdxv2p3 → seccompprofiles}/etcd.go
  170. +89 −0 pkg/registry/softwarecomposition/seccompprofiles/strategy.go
  171. +1 −3 pkg/registry/softwarecomposition/vulnerabilitymanifest/strategy.go
  172. +1 −3 pkg/registry/softwarecomposition/vulnerabilitymanifestsummary/strategy.go
  173. +1 −2 pkg/registry/softwarecomposition/vulnerabilitysummary/strategy.go
  174. +1 −2 pkg/registry/softwarecomposition/workloadconfigurationscans/strategy.go
  175. +1 −2 pkg/registry/softwarecomposition/workloadconfigurationscansummary/strategy.go
  176. +67 −0 pkg/utils/mutex.go
  177. +41 −0 pkg/utils/synchronizer.go
  178. +123 −0 pkg/utils/synchronizer_test.go
  179. +83 −0 pkg/utils/testdata/networkPolicy.json
  180. +59 −0 pkg/utils/testdata/networkPolicyCleaned.json
  181. +435 −0 pkg/utils/testdata/node.json
  182. +402 −0 pkg/utils/testdata/nodeCleaned.json
  183. +165 −0 pkg/utils/testdata/pod.json
  184. +31 −0 pkg/utils/validations.go
  185. +108 −0 pkg/utils/validations_test.go
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.git
vendor
artifacts
4 changes: 2 additions & 2 deletions .github/workflows/pr-created.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore:
- '*.md'
- '*.md'
- '*.yaml'
- '.github/workflows/*'

@@ -16,5 +16,5 @@ jobs:
uses: kubescape/workflows/.github/workflows/incluster-comp-pr-created.yaml@main
with:
CGO_ENABLED: 0
GO_VERSION: "1.21"
GO_VERSION: "1.23"
secrets: inherit
8 changes: 4 additions & 4 deletions .github/workflows/pr-merged.yaml
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@ name: build
on:
pull_request_target:
types: [closed]
branches:
branches:
- 'main'
paths-ignore:
- '**.md' ### Ignore running when README.MD changed.
- '.github/workflows/*' ### Ignore running when files under path: .github/workflows/* changed.

jobs:
pr-merged:
if: ${{ github.event.pull_request.merged == true }} ## Skip if not merged
if: ${{ github.event.pull_request.merged == true }} ## Skip if not merged
uses: kubescape/workflows/.github/workflows/incluster-comp-pr-merged.yaml@main
with:
IMAGE_NAME: quay.io/${{ github.repository_owner }}/storage
@@ -19,7 +19,7 @@ jobs:
CGO_ENABLED: 0
GO111MODULE: "on"
BUILD_PLATFORM: linux/amd64,linux/arm64
GO_VERSION: "1.21"
GO_VERSION: "1.23"
REQUIRED_TESTS: '[
"relevantCVEs",
"relevancy_enabled_stop_sniffing",
5 changes: 5 additions & 0 deletions ADOPTERS.md
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions COMMUNITY.md
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Contributing guidelines
# Contributing

Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes.
The Kubescape project manages this document in the central project repository.

This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/sample-apiserver](https://git.k8s.io/kubernetes/staging/src/k8s.io/sample-apiserver) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot).

Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information
Go to the [centralized CONTRIBUTING.md](https://github.com/kubescape/project-governance/blob/main/CONTRIBUTING.md)
5 changes: 5 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 4 additions & 2 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Project maintainers
# Maintainers

Kubescape Storage is part of the Kubescape project, see maintainers [here](https://github.com/kubescape/kubescape/blob/master/MAINTAINERS.md)
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)
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
DOCKERFILE_PATH=./build/Dockerfile
BINARY_NAME=storage

TAG?=test
IMAGE?=quay.io/kubescape/$(BINARY_NAME)


build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BINARY_NAME)

docker-build:
docker buildx build --platform linux/amd64 -t $(IMAGE):$(TAG) -f $(DOCKERFILE_PATH) .
docker buildx build --platform linux/amd64 -t $(IMAGE):$(TAG) --load -f $(DOCKERFILE_PATH) .
docker-push:
docker push $(IMAGE):$(TAG)
73 changes: 66 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -60,6 +60,56 @@ then you already have a copy of this demo in
`kubernetes/staging/src/k8s.io/sample-apiserver` and its dependencies
--- including the code generator --- are in usable locations.

## Design changes

Compared to the upstream repository, the following changes have been made:
- metadata are stored in a SQLite database
- payload are stored in a virtual filesystem (afero) mapping to a directory

### Database schema

```mermaid
erDiagram
METADATA {
string kind
string namespace
string name
JSON metadata
}
RESOURCE only one to one METADATA : has
```

Metadata are stored in JSON format, and should be unmarshalled to the appropriate struct when needed.

GetList() operations should support pagination, we are using ROWID to sort the results and limit the number
of rows returned. On subsequent calls, the client provides the last ROWID to get the next page.

### Filesystem layout

The filesystem contains both the metadata database and the payload files.

```mermaid
graph LR
root["/data/"] --> metadata.sq3
root --> metadata.sq3-shm
root --> metadata.sq3-wal
root --> spdx["spdx.softwarecomposition.kubescape.io/"]
spdx --> ap["applicationprofiles/"]
ap --> aps["..."]
spdx --> sbom["sbomsyft/"]
sbom --> sboms["..."]
spdx --> sbomf["sbomsyftfiltered/"]
sbomf --> sbomfs["..."]
spdx --> vuln["vulnerabilitymanifests/"]
vuln --> ns1["namespace1/"]
ns1 --> dp1["deployment-deployment1.g"]
ns1 --> dp2["deployment-deployment2.g"]
ns1 --> pod1["pod-pod1.g"]
ns1 --> st1["statefulset-statefulset1.g"]
```

Payloads are stored in Gob format, and since they can be quite big, we are using direct I/O when possible
to reduce memory allocations when unmarshalling them.

## Normal Build and Deploy

@@ -91,22 +141,31 @@ The code generation script will give you warnings about API rule violations.
Don’t mind them. To address these warnings, add them to the exclusion list as
show in the updated upstream repo.

You will also see a warning about `generate-internal-groups.sh` being deprecated:
Now it's time to generate the protobuf code:
```
WARNING: generate-internal-groups.sh is deprecated.
WARNING: Please use k8s.io/code-generator/kube_codegen.sh instead.
docker buildx build --file build/protoc.Dockerfile --platform linux/amd64 --tag protoc --load .
docker run --rm -it -v "$(pwd):/work" protoc
mkdir -p github.com/kubescape/storage
ln -sf /work/pkg github.com/kubescape/storage/
/go/bin/go-to-protobuf --packages=github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1 --go-header-file=./hack/boilerplate.go.txt --apimachinery-packages='-k8s.io/apimachinery/pkg/util/intstr,-k8s.io/apimachinery/pkg/api/resource,-k8s.io/apimachinery/pkg/runtime/schema,-k8s.io/apimachinery/pkg/runtime,-k8s.io/apimachinery/pkg/apis/meta/v1,-k8s.io/apimachinery/pkg/apis/meta/v1beta1,-k8s.io/api/core/v1,-k8s.io/api/rbac/v1' --proto-import=/go/src/k8s.io/kubernetes/staging/src/ --proto-import=/go/src/k8s.io/kubernetes/vendor
```

This is valid, and upstream has also been updated to use the latest code
generation script — `kube_codegen.sh`. However, as of now it breaks code
generation for us, and we had no opportunity to reconcile the changes.

Once the code generation finishes successfully, you should be able to run tests and build the binary with no errors:
```
go build -v ./...
go test -v -failfast -count=1 ./...
```

### Storage operations

During storage operations there are several opportunities to either reject the request or modify the stored object before it is written.

Each type of operation (Create/Update/Delete) has its own set of functions that will run in the lifecycle of the request.

These functions are declared in `pkg/registry/softwarecomposition/<type>/strategy.go`

Read more about each function and its use [here](https://github.com/kubernetes-sigs/apiserver-builder-alpha/blob/master/docs/concepts/api_building_overview.md#storage-operations)

### Authentication plugins

The normal build supports only a very spare selection of
10 changes: 7 additions & 3 deletions SECURITY-INSIGHTS.yml
Original file line number Diff line number Diff line change
@@ -4,15 +4,19 @@ header:
last-reviewed: '2023-10-12'
expiration-date: '2024-10-12T01:00:00.000Z'
project-url: https://github.com/kubescape/kubevuln/
project-release: '1.0.0'
project-release: 1.0.0
project-lifecycle:
stage: active
bug-fixes-only: false
core-maintainers:
- github:slashben
- github:amirmalka
- github:amitschendel
- github:bezbran
- github:craigbox
- github:matthyx
- github:dwertent
- github:matthyx
- github:rotemamsa
- github:slashben
contribution-policy:
accepts-pull-requests: true
accepts-automated-pull-requests: false
8 changes: 3 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Reporting Security Issues
# Security

To report a security issue or vulnerability, submit a [private vulnerability report via GitHub](https://github.com/kubescape/kubevuln/security/advisories/new) to the repository maintainers with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue.
The Kubescape project manages this document in the central project repository.

The maintainers will respond within 7 working days of your report. If the issue is confirmed as a vulnerability, we will open a Security Advisory and acknowledge your contributions as part of it. This project follows a 90 day disclosure timeline.

Other contacts: cncf-kubescape-maintainers@lists.cncf.io
Go to the [centralized SECURITY.md](https://github.com/kubescape/project-governance/blob/main/SECURITY.md)
1 change: 0 additions & 1 deletion artifacts/configurationscansummaries/01-example.yaml
Original file line number Diff line number Diff line change
@@ -13,4 +13,3 @@ spec:
low: 2
unknown: 2
controls: {}

3 changes: 0 additions & 3 deletions artifacts/configurationscansummaries/02-example.yaml
Original file line number Diff line number Diff line change
@@ -13,6 +13,3 @@ spec:
low: 5
unknown: 5
controls: {}



2 changes: 1 addition & 1 deletion artifacts/configurationscansummaries/03-example.yaml
Original file line number Diff line number Diff line change
@@ -12,4 +12,4 @@ spec:
medium: 5
low: 5
unknown: 5
controls: {}
controls: {}
2 changes: 1 addition & 1 deletion artifacts/configurationscansummaries/04-example.yaml
Original file line number Diff line number Diff line change
@@ -12,4 +12,4 @@ spec:
medium: 5
low: 5
unknown: 5
controls: {}
controls: {}
42 changes: 42 additions & 0 deletions artifacts/networkneighborhood/01-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: spdx.softwarecomposition.kubescape.io/v1beta1
kind: NetworkNeighborhood
metadata:
name: deployment-nginx
annotations:
kubescape.io/status: ready
labels:
"kubescape.io/workload-api-group": "apps"
"kubescape.io/workload-api-version": "v1"
"kubescape.io/workload-name": "nginx"
"kubescape.io/workload-kind": "deployment"
"kubescape.io/workload-namespace": "kubescape"

spec:
matchLabels:
app: nginx

containers:
- name: nginx
ingress:
- type: internal
identifier: bla
namespaceSelector:
matchLabels:
name: kubescape
podSelector:
matchLabels:
app: kubescape-ui
ports:
- name: TCP-6379
protocol: TCP
port: 6379

egress:
- type: external
identifier: bla
ipAddress: 123.5.2.3
dns: stripe.com
ports:
- name: TCP-5978
protocol: TCP
port: 5978
8 changes: 0 additions & 8 deletions artifacts/sbomsummaries/01-example.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.21-bullseye as builder
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS builder

ENV GO111MODULE=on CGO_ENABLED=0
WORKDIR /work
@@ -9,7 +9,7 @@ RUN --mount=target=. \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/storage .

FROM gcr.io/distroless/static-debian11:nonroot
FROM gcr.io/distroless/static-debian12:nonroot

COPY --from=builder /out/storage /usr/bin/storage

13 changes: 13 additions & 0 deletions build/protoc.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS builder

ENV GO111MODULE=on CGO_ENABLED=0
WORKDIR /work

RUN git clone -q --depth 1 https://github.com/kubernetes/kubernetes.git /go/src/k8s.io/kubernetes
RUN go install github.com/gogo/protobuf/protoc-gen-gogo@latest
RUN go install golang.org/x/tools/cmd/goimports@latest
RUN go install k8s.io/code-generator/cmd/go-to-protobuf@latest
RUN apt-get update && apt-get install -y unzip
RUN wget -q -O /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.0/protoc-28.0-linux-x86_64.zip && \
unzip -q /tmp/protoc.zip -d /usr/local && \
rm /tmp/protoc.zip
Loading