-
Notifications
You must be signed in to change notification settings - Fork 11
dsfkit with cm (#472) #473
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cfd9992
dsfkit with cm (#472)
sivan-hajbi-imperva 154877f
code review comments
sivan-hajbi-imperva dd4852f
add cte ddc agents
sivan-hajbi-imperva 20b5a34
fix ami_id, ciphertrust deplyment based on sonar version and some fixes
sivan-hajbi-imperva bea073e
fix ciphertrust manager module folder name
sivan-hajbi-imperva 99fefbf
add readme
sivan-hajbi-imperva 592b2f8
fix sonar version
sivan-hajbi-imperva c7a2de8
Commit on behalf of Sivan: In CM integration, temporarily support Son…
lindanasredin ebb94ed
Set default value of enable_ciphertrust to false until dsf_poc_cli ac…
lindanasredin 0aa1257
Added sonar-with-fam test
lindanasredin 8eb14ca
fix module paths
sivan-hajbi-imperva 61dbe58
disable test_apply in release.yml
sivan-hajbi-imperva ae990e0
Merge remote-tracking branch 'origin/dsfkit_with_cm_dev' into dsfkit_…
lindanasredin a2e8555
Added 'all-permutations' option to AWS POC CLI action + other changes
lindanasredin 134a77d
Changed description of DSF POC CLI action input
lindanasredin 4428968
Changed description of DSF POC CLI action input
lindanasredin af754a3
Fixed DSF POC CLI yaml issue + changed enable_ciphertrust default to …
lindanasredin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| locals { | ||
| cte_ddc_linux_count = local.ciphertrust_manager_count > 0 ? var.cte_ddc_agents_linux_count : 0 | ||
| cte_linux_count = local.ciphertrust_manager_count > 0 ? var.cte_agents_linux_count : 0 | ||
| ddc_linux_count = local.ciphertrust_manager_count > 0 ? var.ddc_agents_linux_count : 0 | ||
| cte_ddc_windows_count = local.ciphertrust_manager_count > 0 ? var.cte_ddc_agents_windows_count : 0 | ||
| cte_windows_count = local.ciphertrust_manager_count > 0 ? var.cte_agents_windows_count : 0 | ||
| ddc_windows_count = local.ciphertrust_manager_count > 0 ? var.ddc_agents_windows_count : 0 | ||
| total_agents_count = local.cte_ddc_linux_count + local.cte_ddc_windows_count | ||
|
sivan-hajbi-imperva marked this conversation as resolved.
Outdated
|
||
|
|
||
| installation_map = { | ||
| "Red Hat" = { | ||
| cte_installation_path = var.cte_agent_linux_installation_file | ||
| ddc_installation_path = var.ddc_agent_linux_installation_file | ||
| }, | ||
| "Windows" = { | ||
| cte_installation_path = var.cte_agent_windows_installation_file | ||
| ddc_installation_path = var.ddc_agent_windows_installation_file | ||
| } | ||
| } | ||
|
|
||
| # Prepare Linux Agent Instances | ||
| linux_cte_ddc_instances = [for i in range(local.cte_ddc_linux_count) : { | ||
| id = "cte-ddc-agent-linux-${i}" | ||
| os_type = "Red Hat" | ||
| install_cte = true | ||
| install_ddc = true | ||
| }] | ||
| linux_cte_only_instances = [for i in range(var.cte_agents_linux_count) : { | ||
| id = "cte-agent-linux-${i}" | ||
| os_type = "Red Hat" | ||
| install_cte = true | ||
| install_ddc = false | ||
| }] | ||
| linux_ddc_only_instances = [for i in range(var.ddc_agents_linux_count) : { | ||
| id = "ddc-agent-linux-${i}" | ||
| os_type = "Red Hat" | ||
| install_cte = false | ||
| install_ddc = true | ||
| }] | ||
| # Prepare Windows Agent Instances | ||
| windows_cte_ddc_instances = [for i in range(local.cte_ddc_windows_count) : { | ||
| id = "cte-ddc-agent-windows-${i}" | ||
| os_type = "Windows" | ||
| install_cte = true | ||
| install_ddc = true | ||
| }] | ||
| windows_cte_only_instances = [for i in range(var.cte_agents_windows_count) : { | ||
| id = "cte-agent-windows-${i}" | ||
| os_type = "Windows" | ||
| install_cte = true | ||
| install_ddc = false | ||
| }] | ||
| windows_ddc_only_instances = [for i in range(var.ddc_agents_windows_count) : { | ||
| id = "ddc-agent-windows-${i}" | ||
| os_type = "Windows" | ||
| install_cte = false | ||
| install_ddc = true | ||
| }] | ||
|
|
||
|
|
||
| # Concatenate all ahent lists and convert to a map for for_each | ||
|
sivan-hajbi-imperva marked this conversation as resolved.
Outdated
|
||
| all_agent_instances_map = { | ||
| for instance in concat( | ||
| local.linux_cte_ddc_instances, | ||
| local.linux_cte_only_instances, | ||
| local.linux_ddc_only_instances, | ||
| local.windows_cte_ddc_instances, | ||
| local.windows_cte_only_instances, | ||
| local.windows_ddc_only_instances | ||
| ) : instance.id => instance | ||
| } | ||
| } | ||
|
|
||
| resource "ciphertrust_cte_registration_token" "reg_token" { | ||
|
sivan-hajbi-imperva marked this conversation as resolved.
|
||
| count = length(local.all_agent_instances_map) > 0 ? 1 : 0 | ||
| lifetime = "24h" | ||
| max_clients = 100 | ||
| name_prefix = "cte-agent" | ||
| } | ||
|
|
||
| module "cte_ddc_agents" { | ||
| source = "../../../../modules/aws/cte-ddc-agent" | ||
|
sivan-hajbi-imperva marked this conversation as resolved.
|
||
| # source = "imperva/dsf-cte-ddc-agent/aws" | ||
| # version = "1.7.17" # latest release tag | ||
| # count = local.cte_ddc_linux_count | ||
| for_each = local.all_agent_instances_map | ||
| friendly_name = join("-", [local.deployment_name_salted, each.value.id]) | ||
| subnet_id = local.cte_ddc_agent_subnet_id | ||
| ssh_key_pair = { | ||
| ssh_private_key_file_path = module.key_pair.private_key_file_path | ||
| ssh_public_key_name = module.key_pair.key_pair.key_pair_name | ||
| } | ||
| os_type = each.value.os_type | ||
| attach_persistent_public_ip = true | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can add variables later |
||
| use_public_ip = true | ||
| allowed_ssh_cidrs = concat(local.workstation_cidr, var.allowed_ssh_cidrs) | ||
| allowed_rdp_cidrs = each.value.os_type == "Windows" ? concat(local.workstation_cidr, var.allowed_ssh_cidrs) : null | ||
|
sivan-hajbi-imperva marked this conversation as resolved.
|
||
| cipher_trust_manager_address = module.ciphertrust_manager[0].private_ip | ||
| agent_installation = { | ||
| registration_token = ciphertrust_cte_registration_token.reg_token[0].token | ||
| install_cte = each.value.install_cte | ||
| install_ddc = each.value.install_ddc | ||
| cte_agent_installation_file = each.value.install_cte ? local.installation_map[each.value.os_type].cte_installation_path : null | ||
| ddc_agent_installation_file = each.value.install_ddc ? local.installation_map[each.value.os_type].ddc_installation_path : null | ||
| } | ||
| tags = local.tags | ||
| depends_on = [ | ||
| module.vpc, | ||
| module.ciphertrust_manager, | ||
| ciphertrust_trial_license.trial_license, | ||
| module.ciphertrust_manager_cluster_setup | ||
| ] | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't "local.ciphertrust_manager_count > 0" be "var.enable_ciphertrtrust ?". can var.enable_ciphertrtrust = enabled and ciphertrust_manager_count == 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically it can happen if that what the user set, this is why I check the count instead of the flag