instance_profile.tf 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. module "instance_profile" {
  2. source = "../../submodules/iam/base_instance_profile"
  3. prefix = "xdr-phantom"
  4. aws_partition = var.aws_partition
  5. aws_account_id = var.aws_account_id
  6. }
  7. # Phantom Specific Policy
  8. #resource "aws_iam_policy" "phantom_instance_policy" {
  9. # name = "phantom_instance_policy"
  10. # path = "/launchroles/"
  11. # description = "This policy allows phantom-specific functions"
  12. # policy = data.aws_iam_policy_document.phantom_instance_policy_doc.json
  13. #}
  14. #
  15. #data "aws_iam_policy_document" "phantom_instance_policy_doc" {
  16. # # Allow copying to S3 for frozen
  17. # # Allow use of S3 for SmartStore
  18. # statement {
  19. # sid = "GeneralBucketAccess"
  20. # effect = "Allow"
  21. # actions = [
  22. # "s3:ListAllMyBuckets",
  23. # "s3:HeadBucket",
  24. # ]
  25. # resources = [ "*" ]
  26. # }
  27. #
  28. # statement {
  29. # sid = "S3BucketAccess"
  30. # effect = "Allow"
  31. # actions = [
  32. # "s3:GetLifecycleConfiguration",
  33. # "s3:DeleteObjectVersion",
  34. # "s3:ListBucketVersions",
  35. # "s3:GetBucketLogging",
  36. # "s3:RestoreObject",
  37. # "s3:ListBuckets",
  38. # "s3:GetBucketVersioning",
  39. # "s3:PutObject",
  40. # "s3:GetObject",
  41. # "s3:PutLifecycleConfiguration",
  42. # "s3:GetBucketCORS",
  43. # "s3:DeleteObject",
  44. # "s3:GetBucketLocation",
  45. # "s3:GetObjectVersion",
  46. # ]
  47. # resources = [
  48. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-frozen",
  49. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-frozen/*",
  50. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-smartstore",
  51. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-smartstore/*",
  52. # ]
  53. # }
  54. #
  55. # statement {
  56. # sid = "S3ReadOnlyBucketAccess"
  57. # effect = "Allow"
  58. # actions = [
  59. # "s3:ListBucketVersions",
  60. # "s3:ListBuckets",
  61. # "s3:GetBucketVersioning",
  62. # "s3:GetObject",
  63. # "s3:GetBucketCORS",
  64. # "s3:GetBucketLocation",
  65. # "s3:GetObjectVersion",
  66. # ]
  67. # resources = [
  68. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-apps",
  69. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-apps/*",
  70. # ]
  71. # }
  72. #
  73. # statement {
  74. # sid = "KMSKeyAccess"
  75. # effect = "Allow"
  76. # actions = [
  77. # "kms:Decrypt",
  78. # "kms:GenerateDataKeyWithoutPlaintext",
  79. # "kms:Verify",
  80. # "kms:GenerateDataKeyPairWithoutPlaintext",
  81. # "kms:GenerateDataKeyPair",
  82. # "kms:ReEncryptFrom",
  83. # "kms:Encrypt",
  84. # "kms:GenerateDataKey",
  85. # "kms:ReEncryptTo",
  86. # "kms:Sign",
  87. # ]
  88. # resources = [ "*" ]
  89. # }
  90. #}
  91. #
  92. #resource "aws_iam_role_policy_attachment" "phantom_instance_policy_attach" {
  93. # role = module.instance_profile.role_id
  94. # policy_arn = aws_iam_policy.phantom_instance_policy.arn
  95. #}