8000 Add managed by label to required labels in service autodiscovery by the-simmon · Pull Request #1349 · secureCodeBox/secureCodeBox · GitHub
[go: up one dir, main page]

< 8000 div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Conversation

@the-simmon
Copy link
Contributor

fixes #1194

@the-simmon the-simmon self-assigned this Sep 9, 2022
@the-simmon the-simmon added the breaking Changes requiring a major release label Sep 9, 2022
@github-actions
Copy link
github-actions bot commented Sep 9, 2022

MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
⚠️ GO golangci-lint 1 1 3.26s
✅ SPELL misspell 1 0 0.05s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@J12934 J12934 added this to the v4.0.0 milestone Sep 10, 2022
@Ilyesbdlala
Copy link
Member
Ilyesbdlala commented Oct 5, 2022

As Max mentioned here, I also see no app.kubernetes.io/managed-by=securecodebox-autodiscovery label only app.kubernetes.io/managed-by=securecodebox. Can you clarify this? (Scheduled Scan pod describe yaml is below)

Also a conflict in UPGRADING.md needs also to be resolved :)

Name:             scan-juice-shop-at-350cf9a6ea37138b987a3968d046e61bcd3bb1-dkbkr
Namespace:        default
Priority:         0
Service Account:  lurker
Node:             kind-control-plane/172.18.0.2
Start Time:       Wed, 05 Oct 2022 16:16:19 +0200
Labels:           app.kubernetes.io/managed-by=securecodebox
                  controller-uid=c0af3fee-431c-4c3a-af33-65a877b4caca
                  job-name=scan-juice-shop-at-350cf9a6ea37138b987a3968d046e61bcd3bb1-njqk7
Annotations:      auto-discovery.securecodebox.io/ignore: true
                  sidecar.istio.io/inject: false
Status:           Running
IP:               10.244.0.10
IPs:
  IP:           10.244.0.10
Controlled By:  Job/scan-juice-shop-at-350cf9a6ea37138b987a3968d046e61bcd3bb1-njqk7
Containers:
  trivy:
    Container ID:  containerd://375fa828bf9ffc123895fbe854347bb639cc66f0d135e885e31d6960e53c5601
    Image:         docker.io/aquasec/trivy:0.30.4
    Image ID:      docker.io/aquasec/trivy@sha256:6cbcd67fcc486fb3c984a47ae6882a2f667703994966da6c2e6fe70af104d452
    Port:          <none>
    Host Port:     <none>
    Command:
      trivy
      image
      --no-progress
      --format
      json
      --output
      /home/securecodebox/trivy-results.json
      docker.io/bkimminich/juice-shop@sha256:350cf9a6ea37138b987a3968d046e61bcd3bb18d2ec95290cfc6901bd6013826
    State:          Running
      Started:      Wed, 05 Oct 2022 16:16:33 +0200
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /home/securecodebox/ from scan-results (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-w54ls (ro)
  lurker:
    Container ID:  containerd://4ba24faafe0da49083138a220b17f543917e46ca7e420480f9bf60d2a1722411
    Image:         docker.io/securecodebox/lurker:sha-9785db50
    Image ID:      sha256:973381d0c0700ccb38ea06f3eed9068c8c48d942aaa0bdcd7e466425c49f801c
    Port:          <none>
    Host Port:     <none>
    Args:
      --container
      trivy
      --file
      /home/securecodebox/trivy-results.json
      --url
      http://securecodebox-operator-minio.securecodebox-system.svc.cluster.local:9000/securecodebox/scan-730bd538-9d73-4eee-8692-cbc3f4fd6ba6/trivy-results.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=YOURACCESSKEY%2F20221005%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221005T141619Z&X-Amz-Expires=43200&X-Amz-SignedHeaders=host&X-Amz-Signature=26b6ef71843ca34b3eef5f0d9656a52fd7b78fbdc1fd02ea49b404457021115a
    State:          Running
      Started:      Wed, 05 Oct 2022 16:16:33 +0200
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     100m
      memory:  100Mi
    Requests:
      cpu:     20m
      memory:  20Mi
    Environment:
      NAMESPACE:  default (v1:metadata.namespace)
    Mounts:
      /home/securecodebox/ from scan-results (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-w54ls (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  scan-results:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  kube-api-access-w54ls:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  2m9s  default-scheduler  Successfully assigned default/scan-juice-shop-at-350cf9a6ea37138b987a3968d046e61bcd3bb1-dkbkr to kind-control-plane
  Normal  Pulling    2m9s  kubelet            Pulling image "docker.io/aquasec/trivy:0.30.4"
  Normal  Pulled     116s  kubelet            Successfully pulled image "docker.io/aquasec/trivy:0.30.4" in 13.175216656s
  Normal  Created    116s  kubelet            Created container trivy
  Normal  Started    116s  kubelet            Started container trivy
  Normal  Pulled     116s  kubelet            Container image "docker.io/securecodebox/lurker:sha-9785db50" already present on machine
  Normal  Created    116s  kubelet            Created container lurker
  Normal  Started    116s  kubelet            Started container lurker

@the-simmon
Copy link
Contributor Author

This PR is about lables of the scheduled scans itself, not pods.

apiVersion: execution.securecodebox.io/v1
kind: ScheduledScan
metadata:
  annotations:
    defectdojo.securecodebox.io/engagement-name: juice-shop
    defectdojo.securecodebox.io/engagement-version: v13.0.3
    defectdojo.securecodebox.io/product-name: docker-desktop | default | juice-shop
    defectdojo.securecodebox.io/product-tags: cluster/docker-desktop,namespace/default
  creationTimestamp: "2022-10-05T16:31:42Z"
  generation: 1
  labels:
    app.kubernetes.io/managed-by: securecodebox-autodiscovery
    auto-discovery.securecodebox.io/target-port: "3000"
    auto-discovery.securecodebox.io/target-service: juice-shop
  name: juice-shop-service-port-3000
  namespace: default
  ownerReferences:
  - apiVersion: v1
    blockOwnerDeletion: true
    controller: true
    kind: Service
    name: juice-shop
    uid: 120aa80c-1c2e-412f-98eb-0d756d4445d5
  resourceVersion: "980"
  uid: cab1f655-b452-4539-98cf-77025252d5aa
spec:
  interval: 168h0m0s
  retriggerOnScanTypeChange: true
  scanSpec:
    parameters:
    - -t
    - http://juice-shop.default.svc:3000
    scanType: zap-advanced-scan
status:
  findings:
    severities: {}
  lastScheduleTime: "2022-10-05T16:31:42Z"
  scanTypeHash: "15308950262926841447"

Ilyesbdlala
Ilyesbdlala previously approved these changes Oct 6, 2022
Copy link
Member
@Ilyesbdlala Ilyesbdlala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just fix the merge conflict, and it's ready to merge.

@the-simmon the-simmon force-pushed the maintenance/autodiscovery-managed-by-label branch from db0f7de to 3080ee6 Compare October 11, 2022 09:24
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
@Ilyesbdlala Ilyesbdlala force-pushed the maintenance/autodiscovery-managed-by-label branch from 3080ee6 to 3eca5ac Compare October 12, 2022 12:41
Copy link
Member
@Ilyesbdlala Ilyesbdlala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Ilyesbdlala Ilyesbdlala merged commit 56e20c2 into main Oct 12, 2022
@Ilyesbdlala Ilyesbdlala deleted the maintenance/autodiscovery-managed-by-label branch October 12, 2022 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Changes requiring a major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require managed-by label in Service autodiscovery

4 participants

0