instance_profile.tf 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. # ]
  24. # resources = [ "*" ]
  25. # }
  26. #
  27. # statement {
  28. # sid = "S3BucketAccess"
  29. # effect = "Allow"
  30. # actions = [
  31. # "s3:GetLifecycleConfiguration",
  32. # "s3:DeleteObjectVersion",
  33. # "s3:ListBucketVersions",
  34. # "s3:GetBucketLogging",
  35. # "s3:RestoreObject",
  36. # "s3:ListBucket",
  37. # "s3:GetBucketVersioning",
  38. # "s3:PutObject",
  39. # "s3:GetObject",
  40. # "s3:PutLifecycleConfiguration",
  41. # "s3:GetBucketCORS",
  42. # "s3:DeleteObject",
  43. # "s3:GetBucketLocation",
  44. # "s3:GetObjectVersion",
  45. # ]
  46. # resources = [
  47. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-frozen",
  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-smartstore",
  50. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-smartstore/*",
  51. # ]
  52. # }
  53. #
  54. # statement {
  55. # sid = "S3ReadOnlyBucketAccess"
  56. # effect = "Allow"
  57. # actions = [
  58. # "s3:ListBucketVersions",
  59. # "s3:ListBucket",
  60. # "s3:GetBucketVersioning",
  61. # "s3:GetObject",
  62. # "s3:GetBucketCORS",
  63. # "s3:GetBucketLocation",
  64. # "s3:GetObjectVersion",
  65. # ]
  66. # resources = [
  67. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-apps",
  68. # "arn:${ var.aws_partition }:s3:::xdr-${ var.prefix }-${ var.environment }-splunk-apps/*",
  69. # ]
  70. # }
  71. #
  72. # statement {
  73. # sid = "KMSKeyAccess"
  74. # effect = "Allow"
  75. # actions = [
  76. # "kms:Decrypt",
  77. # "kms:GenerateDataKeyWithoutPlaintext",
  78. # "kms:Verify",
  79. # "kms:GenerateDataKeyPairWithoutPlaintext",
  80. # "kms:GenerateDataKeyPair",
  81. # "kms:ReEncryptFrom",
  82. # "kms:Encrypt",
  83. # "kms:GenerateDataKey",
  84. # "kms:ReEncryptTo",
  85. # "kms:Sign",
  86. # ]
  87. # resources = [ "*" ]
  88. # }
  89. #}
  90. #
  91. #resource "aws_iam_role_policy_attachment" "phantom_instance_policy_attach" {
  92. # role = module.instance_profile.role_id
  93. # policy_arn = aws_iam_policy.phantom_instance_policy.arn
  94. #}