Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-security-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-security-group
Commits
6d7ae228
Unverified
Commit
6d7ae228
authored
Mar 02, 2018
by
Anton Babenko
Committed by
GitHub
Mar 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Splunk ports (#44)
parent
d42372c3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
238 additions
and
1 deletion
+238
-1
README.md
modules/README.md
+1
-0
auto_values.tf
modules/splunk/auto_values.tf
+31
-0
main.tf
modules/splunk/main.tf
+59
-0
outputs.tf
modules/splunk/outputs.tf
+24
-0
variables.tf
modules/splunk/variables.tf
+111
-0
rules.tf
rules.tf
+11
-0
update_groups.sh
update_groups.sh
+1
-1
No files found.
modules/README.md
View file @
6d7ae228
...
@@ -23,6 +23,7 @@ List of Security Groups implemented as Terraform modules
...
@@ -23,6 +23,7 @@ List of Security Groups implemented as Terraform modules
*
[
rdp
](
rdp
)
*
[
rdp
](
rdp
)
*
[
redis
](
redis
)
*
[
redis
](
redis
)
*
[
redshift
](
redshift
)
*
[
redshift
](
redshift
)
*
[
splunk
](
splunk
)
*
[
ssh
](
ssh
)
*
[
ssh
](
ssh
)
*
[
storm
](
storm
)
*
[
storm
](
storm
)
*
[
web
](
web
)
*
[
web
](
web
)
...
...
modules/splunk/auto_values.tf
0 → 100644
View file @
6d7ae228
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable
"auto_ingress_rules"
{
description
=
"List of ingress rules to add automatically"
type
=
"list"
default
=
[
"splunk-indexer-tcp"
,
"splunk-clients-tcp"
,
"splunk-splunkd-tcp"
]
}
variable
"auto_ingress_with_self"
{
description
=
"List of maps defining ingress rules with self to add automatically"
type
=
"list"
default
=
[{
"rule"
=
"all-all"
}]
}
variable
"auto_egress_rules"
{
description
=
"List of egress rules to add automatically"
type
=
"list"
default
=
[
"all-all"
]
}
variable
"auto_egress_with_self"
{
description
=
"List of maps defining egress rules with self to add automatically"
type
=
"list"
default
=
[]
}
modules/splunk/main.tf
0 → 100644
View file @
6d7ae228
module
"sg"
{
source
=
"../../"
create
=
"
${
var
.
create
}
"
name
=
"
${
var
.
name
}
"
description
=
"
${
var
.
description
}
"
vpc_id
=
"
${
var
.
vpc_id
}
"
tags
=
"
${
var
.
tags
}
"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules
=
[
"
${
sort
(
distinct
(
concat
(
var
.
auto_ingress_rules
,
var
.
ingress_rules
)))
}
"
]
# Open for self
ingress_with_self
=
[
"
${
concat
(
var
.
auto_ingress_with_self
,
var
.
ingress_with_self
)
}
"
]
# Open to IPv4 cidr blocks
ingress_with_cidr_blocks
=
[
"
${
var
.
ingress_with_cidr_blocks
}
"
]
# Open to IPv6 cidr blocks
ingress_with_ipv6_cidr_blocks
=
[
"
${
var
.
ingress_with_ipv6_cidr_blocks
}
"
]
# Open for security group id
ingress_with_source_security_group_id
=
[
"
${
var
.
ingress_with_source_security_group_id
}
"
]
# Default ingress CIDR blocks
ingress_cidr_blocks
=
[
"
${
var
.
ingress_cidr_blocks
}
"
]
ingress_ipv6_cidr_blocks
=
[
"
${
var
.
ingress_ipv6_cidr_blocks
}
"
]
# Default prefix list ids
ingress_prefix_list_ids
=
[
"
${
var
.
ingress_prefix_list_ids
}
"
]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules
=
[
"
${
sort
(
distinct
(
concat
(
var
.
auto_egress_rules
,
var
.
egress_rules
)))
}
"
]
# Open for self
egress_with_self
=
[
"
${
concat
(
var
.
auto_egress_with_self
,
var
.
egress_with_self
)
}
"
]
# Open to IPv4 cidr blocks
egress_with_cidr_blocks
=
[
"
${
var
.
egress_with_cidr_blocks
}
"
]
# Open to IPv6 cidr blocks
egress_with_ipv6_cidr_blocks
=
[
"
${
var
.
egress_with_ipv6_cidr_blocks
}
"
]
# Open for security group id
egress_with_source_security_group_id
=
[
"
${
var
.
egress_with_source_security_group_id
}
"
]
# Default egress CIDR blocks
egress_cidr_blocks
=
[
"
${
var
.
egress_cidr_blocks
}
"
]
egress_ipv6_cidr_blocks
=
[
"
${
var
.
egress_ipv6_cidr_blocks
}
"
]
# Default prefix list ids
egress_prefix_list_ids
=
[
"
${
var
.
egress_prefix_list_ids
}
"
]
}
modules/splunk/outputs.tf
0 → 100644
View file @
6d7ae228
output
"this_security_group_id"
{
description
=
"The ID of the security group"
value
=
"
${module
.
sg
.
this_security_group_id
}
"
}
output
"this_security_group_vpc_id"
{
description
=
"The VPC ID"
value
=
"
${module
.
sg
.
this_security_group_vpc_id
}
"
}
output
"this_security_group_owner_id"
{
description
=
"The owner ID"
value
=
"
${module
.
sg
.
this_security_group_owner_id
}
"
}
output
"this_security_group_name"
{
description
=
"The name of the security group"
value
=
"
${module
.
sg
.
this_security_group_name
}
"
}
output
"this_security_group_description"
{
description
=
"The description of the security group"
value
=
"
${module
.
sg
.
this_security_group_description
}
"
}
modules/splunk/variables.tf
0 → 100644
View file @
6d7ae228
#################
# Security group
#################
variable
"create"
{
description
=
"Whether to create security group and all rules"
default
=
true
}
variable
"vpc_id"
{
description
=
"ID of the VPC where to create security group"
}
variable
"name"
{
description
=
"Name of security group"
}
variable
"description"
{
description
=
"Description of security group"
default
=
"Security Group managed by Terraform"
}
variable
"tags"
{
description
=
"A mapping of tags to assign to security group"
default
=
{}
}
##########
# Ingress
##########
variable
"ingress_rules"
{
description
=
"List of ingress rules to create by name"
default
=
[]
}
variable
"ingress_with_self"
{
description
=
"List of ingress rules to create where 'self' is defined"
default
=
[]
}
variable
"ingress_with_cidr_blocks"
{
description
=
"List of ingress rules to create where 'cidr_blocks' is used"
default
=
[]
}
variable
"ingress_with_ipv6_cidr_blocks"
{
description
=
"List of ingress rules to create where 'ipv6_cidr_blocks' is used"
default
=
[]
}
variable
"ingress_with_source_security_group_id"
{
description
=
"List of ingress rules to create where 'source_security_group_id' is used"
default
=
[]
}
variable
"ingress_cidr_blocks"
{
description
=
"List of IPv4 CIDR ranges to use on all ingress rules"
default
=
[]
}
variable
"ingress_ipv6_cidr_blocks"
{
description
=
"List of IPv6 CIDR ranges to use on all ingress rules"
default
=
[]
}
variable
"ingress_prefix_list_ids"
{
description
=
"List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default
=
[]
}
#########
# Egress
#########
variable
"egress_rules"
{
description
=
"List of egress rules to create by name"
default
=
[]
}
variable
"egress_with_self"
{
description
=
"List of egress rules to create where 'self' is defined"
default
=
[]
}
variable
"egress_with_cidr_blocks"
{
description
=
"List of egress rules to create where 'cidr_blocks' is used"
default
=
[]
}
variable
"egress_with_ipv6_cidr_blocks"
{
description
=
"List of egress rules to create where 'ipv6_cidr_blocks' is used"
default
=
[]
}
variable
"egress_with_source_security_group_id"
{
description
=
"List of egress rules to create where 'source_security_group_id' is used"
default
=
[]
}
variable
"egress_cidr_blocks"
{
description
=
"List of IPv4 CIDR ranges to use on all egress rules"
default
=
[
"0.0.0.0/0"
]
}
variable
"egress_ipv6_cidr_blocks"
{
description
=
"List of IPv6 CIDR ranges to use on all egress rules"
default
=
[
"::/0"
]
}
variable
"egress_prefix_list_ids"
{
description
=
"List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default
=
[]
}
rules.tf
View file @
6d7ae228
...
@@ -101,6 +101,11 @@ variable "rules" {
...
@@ -101,6 +101,11 @@ variable "rules" {
# Redshift
# Redshift
redshift
-
tcp
=
[
5439
,
5439
,
"tcp"
,
"Redshift"
]
redshift
-
tcp
=
[
5439
,
5439
,
"tcp"
,
"Redshift"
]
# Splunk
splunk
-
indexer
-
tcp
=
[
9997
,
9997
,
"tcp"
,
"Splunk indexer"
]
splunk
-
clients
-
tcp
=
[
8080
,
8080
,
"tcp"
,
"Splunk clients"
]
splunk
-
splunkd
-
tcp
=
[
8089
,
8089
,
"tcp"
,
"Splunkd"
]
# SSH
# SSH
ssh
-
tcp
=
[
22
,
22
,
"tcp"
,
"SSH"
]
ssh
-
tcp
=
[
22
,
22
,
"tcp"
,
"SSH"
]
...
@@ -269,6 +274,12 @@ variable "auto_groups" {
...
@@ -269,6 +274,12 @@ variable "auto_groups" {
egress_rules
=
[
"all-all"
]
egress_rules
=
[
"all-all"
]
}
}
splunk
=
{
ingress_rules
=
[
"splunk-indexer-tcp"
,
"splunk-clients-tcp"
,
"splunk-splunkd-tcp"
]
ingress_with_self
=
[
"all-all"
]
egress_rules
=
[
"all-all"
]
}
ssh
=
{
ssh
=
{
ingress_rules
=
[
"ssh-tcp"
]
ingress_rules
=
[
"ssh-tcp"
]
ingress_with_self
=
[
"all-all"
]
ingress_with_self
=
[
"all-all"
]
...
...
update_groups.sh
View file @
6d7ae228
...
@@ -140,4 +140,4 @@ EOF
...
@@ -140,4 +140,4 @@ EOF
echo
"Done!"
echo
"Done!"
}
}
main
main
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment