Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASM] product features activation #1165

Merged
merged 8 commits into from
May 28, 2024
Merged

[ASM] product features activation #1165

merged 8 commits into from
May 28, 2024

Conversation

eliottness
Copy link
Collaborator

@eliottness eliottness commented May 2, 2024

What does this PR do?

This PR adds the ASM features activation under the feature.asm field in the DatadogAgent crd. Its only goal is to propagate environment variables to the cluster-agent admission controller (cf. DataDog/datadog-agent#23618)

Sister PR of DataDog/helm-charts#1337
Clone of #1151

Motivation

Part of Single Step Activation for ASM products

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Cluster Agent: v7.53.0

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

Test Instruction

if the admission controller is not disabled, then there is a OneToOne relation between the DatadogAgent manifest and the env of the cluster agent like this:

  • asm.threats.enabled -> DD_ADMISSION_CONTROLLER_AUTO_INSTRUMENTATION_APPSEC_ENABLED
  • asm.sca.enabled -> DD_ADMISSION_CONTROLLER_AUTO_INSTRUMENTATION_APPSEC_SCA_ENABLED
  • asm.iast.enabled -> DD_ADMISSION_CONTROLLER_AUTO_INSTRUMENTATION_IAST_ENABLED

Manifest example:

apiVersion: datadoghq.com/v1alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  features:
     asm:
       threats:
         enabled: true
       sca:
         enabled: true
       iast:
         enabled: true

@eliottness eliottness added the enhancement New feature or request label May 2, 2024
@eliottness eliottness self-assigned this May 2, 2024
@eliottness eliottness requested review from a team as code owners May 2, 2024 19:37
@eliottness eliottness mentioned this pull request May 2, 2024
2 tasks
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2024

Codecov Report

Attention: Patch coverage is 75.58140% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 59.23%. Comparing base (8981855) to head (34ad7f9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1165      +/-   ##
==========================================
+ Coverage   59.16%   59.23%   +0.06%     
==========================================
  Files         175      176       +1     
  Lines       21944    22031      +87     
==========================================
+ Hits        12984    13050      +66     
- Misses       8164     8181      +17     
- Partials      796      800       +4     
Flag Coverage Δ
unittests 59.23% <75.58%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
apis/datadoghq/v2alpha1/datadogagent_default.go 92.05% <100.00%> (+0.53%) ⬆️
apis/datadoghq/v2alpha1/datadogagent_types.go 100.00% <ø> (ø)
controllers/datadogagent/controller.go 59.25% <ø> (ø)
controllers/datadogagent/feature/asm/feature.go 69.11% <69.11%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8981855...34ad7f9. Read the comment docs.

@eliottness eliottness requested a review from a team as a code owner May 2, 2024 19:56
Copy link
Contributor

@drichards-87 drichards-87 left a comment

Choose a reason for hiding this comment

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

Left a couple of small suggestions from Docs and approved the PR.

docs/configuration.v2alpha1.md Outdated Show resolved Hide resolved
docs/configuration.v2alpha1.md Outdated Show resolved Hide resolved
Copy link
Contributor

@celenechang celenechang left a comment

Choose a reason for hiding this comment

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

I believe you also need to "register" this feature here

I made some suggestions, feel free to ping me if you have questions or need another review

apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
apis/datadoghq/v2alpha1/datadogagent_types.go Outdated Show resolved Hide resolved
controllers/datadogagent/feature/asm/feature.go Outdated Show resolved Hide resolved
controllers/datadogagent/feature/asm/feature.go Outdated Show resolved Hide resolved
@levan-m levan-m added this to the v1.7.0 milestone May 23, 2024
@eliottness eliottness force-pushed the eliott.bouhana/asm-ssi branch 2 times, most recently from b3b873b to 560c1ea Compare May 24, 2024 13:15
eliottness and others added 7 commits May 24, 2024 19:13
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Co-authored-by: Celene <celene@datadoghq.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
@celenechang celenechang merged commit 0ad74a7 into main May 28, 2024
19 checks passed
@celenechang celenechang deleted the eliott.bouhana/asm-ssi branch May 28, 2024 12:08
mftoure pushed a commit that referenced this pull request Oct 3, 2024
* asm product configuration & activation

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>

* setup asm feature

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>

* run make generate

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>

* Apply suggestions from code review

Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com>
Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>

* Apply suggestions from code review

Co-authored-by: Celene <celene@datadoghq.com>

* apply code reviez suggestion

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>

* Fix Admission Controller check and add tests

* Apply suggestion from @celenechang

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>

---------

Signed-off-by: Eliott Bouhana <eliott.bouhana@datadoghq.com>
Co-authored-by: DeForest Richards <56796055+drichards-87@users.noreply.github.com>
Co-authored-by: Celene <celene@datadoghq.com>
Co-authored-by: Levan Machablishvili <levan.machablishvili@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants