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

feat(application_scope_saas): SLK-88697-aquasec-application-scope-saas #285

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MosenzonTal
Copy link
Collaborator

@MosenzonTal MosenzonTal commented Jan 23, 2025

SLK-88697

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Tal Mosenzon seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@semyonm0r semyonm0r changed the title Slk 88697 aquasec application scope saas feat(application_scope_saas): create resource, data for application scope saas Jan 23, 2025
@semyonm0r semyonm0r changed the title feat(application_scope_saas): create resource, data for application scope saas feat(application_scope_saas): create resource, datasource, example, docs Jan 23, 2025
@MosenzonTal MosenzonTal force-pushed the SLK-88697-aquasec-application-scope-saas branch 2 times, most recently from c5da21a to 54ec15d Compare January 27, 2025 13:27
@MosenzonTal MosenzonTal changed the title feat(application_scope_saas): create resource, datasource, example, docs feat(application_scope_saas): SLK-88697-aquasec-application-scope-saas Jan 27, 2025
@MosenzonTal MosenzonTal force-pushed the SLK-88697-aquasec-application-scope-saas branch 2 times, most recently from ce328c0 to 1eccba5 Compare January 29, 2025 13:44
Supports the new RBAC v3 feature set
Covers the entire SaaS platform and not limited to CSP-only

Resolves: SLK-88697
@MosenzonTal MosenzonTal force-pushed the SLK-88697-aquasec-application-scope-saas branch from 8622d94 to 7b6f94d Compare January 29, 2025 13:46
@smorodin2024
Copy link

@semyonm0r I tried this branch and did not find the fix for Additional Scope Criteria from a Runtime Policy. Terraform provider can't update this field.
My Terraform script tried to update the additional scope from kubernetes.cluster.initial_cluster_name to kubernetes.cluster.new_cluster_name and was not able to do so. Terraform apply returns success, but Aquasec Web UI shows old value initial_cluster_name.

@semyonm0r
Copy link
Collaborator

@smorodin2024 this branch not supposed to solve the runtime policy. We not managed to reproduce your issue, will try to use details from your comment and reproduce it today.
if you can share with me example (tf code) will help us.
@MosenzonTal let’s try to check it today

@MosenzonTal
Copy link
Collaborator Author

@semyonm0r I tried this branch and did not find the fix for Additional Scope Criteria from a Runtime Policy. Terraform provider can't update this field. My Terraform script tried to update the additional scope from kubernetes.cluster.initial_cluster_name to kubernetes.cluster.new_cluster_name and was not able to do so. Terraform apply returns success, but Aquasec Web UI shows old value initial_cluster_name.

you need to use “scope { }” instead of “scope_expression & scope_variables”.

as mentioned in the example ofCreate Runtime Policy POST /runtime_policies in the API Docs:
https://docs.aquasec.com/saas/api-reference/workload-protection-api/v2-api/runtime-policies/runtime-policy-create-new/#/Runtime Policies/Runtime_policy_create_new
attaching working code example:

resource "aquasec_container_runtime_policy" "container_runtime_policy_praveen" {
  name             = "container_runtime_policy_praveen2"
  description      = "container_runtime_policy"
  scope {
    expression = "v1 && v2"

    variables {
      attribute = "kubernetes.cluster"
      value     = "default"
    }
    variables {
      attribute = "kubernetes.label"
      name      = "app"     
      value     = "aqua"    
    }
  }
  application_scopes = [
    "app_scope",
  ]
  enabled              = true
  enforce              = false
  block_container_exec = true
  container_exec_allowed_processes = [
    "proc1",
    "proc2"
  ]
  block_cryptocurrency_mining   = true
  block_fileless_exec           = true
  block_non_compliant_workloads = true
  block_non_k8s_containers      = true
  blocked_capabilities = [
    "AUDIT_CONTROL",
    "AUDIT_WRITE"
  ]

  blocked_executables = [
    "exe1",
    "exe2",
  ]
  blocked_files = [
    "test1",
    "test2"
  ]
  malware_scan_options {
    enabled = true
    action  = "alert"
    #exclude_directories = [ "/var/run/" ]
  }

  audit_all_processes_activity = true
  audit_full_command_arguments = true
  audit_all_network_activity   = true
  enable_fork_guard            = true
  fork_guard_process_limit     = 13
  block_access_host_network    = true
  block_adding_capabilities    = true
  block_root_user              = true
  block_privileged_containers  = true
  block_use_ipc_namespace      = true
  block_use_pid_namespace      = true
  block_use_user_namespace     = true
  block_use_uts_namespace      = true
  block_low_port_binding       = true
  limit_new_privileges         = true
  blocked_packages = [
    "pkg",
    "pkg2"
  ]
  blocked_inbound_ports = [
    "80",
    "8080"
  ]
  blocked_outbound_ports = [
    "90",
    "9090"
  ]

  monitor_system_time_changes = "true"
  blocked_volumes = [
    "blocked",
    "vol"
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants