diff --git a/.github/workflows/OS.tfvars b/.github/workflows/OS.tfvars index 99064fb..5baddfc 100644 --- a/.github/workflows/OS.tfvars +++ b/.github/workflows/OS.tfvars @@ -1,8 +1,8 @@ #Ami Rocky 85 -ami_id = "ami-043ceee68871e0bb5" -ami_os = "rocky8" -ami_username = "rocky" -ami_user_home = "/home/rocky" +ami_id = "ami-0c41531b8d18cc72b" +ami_os = "rhel9" +ami_username = "ec2-user" +ami_user_home = "/home/ec2-user" instance_tags = { Name = "RHEL9-CIS" Environment = "lockdown_github_repo_workflow" diff --git a/.github/workflows/github_networks.tf b/.github/workflows/github_networks.tf index d5a0db0..4db9025 100644 --- a/.github/workflows/github_networks.tf +++ b/.github/workflows/github_networks.tf @@ -1,11 +1,11 @@ resource "aws_vpc" "Main" { cidr_block = var.main_vpc_cidr - tags = var.instance_tags + tags = var.instance_tags } resource "aws_internet_gateway" "IGW" { vpc_id = aws_vpc.Main.id tags = { - Name = "${var.namespace}-IGW" + Name = "${var.namespace}-IGW" } } diff --git a/.github/workflows/github_vars.tfvars b/.github/workflows/github_vars.tfvars index 38be3ed..4d40f72 100644 --- a/.github/workflows/github_vars.tfvars +++ b/.github/workflows/github_vars.tfvars @@ -3,7 +3,7 @@ // Declared in variables.tf // -namespace = "github_actions" +namespace = "github_actions" // Matching pair name found in AWS for keypairs PEM key ami_key_pair_name = "github_actions" diff --git a/.github/workflows/main.tf b/.github/workflows/main.tf index 9ad9240..29fd6f3 100644 --- a/.github/workflows/main.tf +++ b/.github/workflows/main.tf @@ -28,7 +28,7 @@ resource "aws_security_group" "github_actions" { protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } - + ingress { from_port = 80 to_port = 80 @@ -44,7 +44,7 @@ resource "aws_security_group" "github_actions" { } tags = { Name = "${var.namespace}-SG" - } + } } // instance setup @@ -57,16 +57,16 @@ resource "aws_instance" "testing_vm" { tags = var.instance_tags vpc_security_group_ids = [aws_security_group.github_actions.id] root_block_device { - delete_on_termination = true + delete_on_termination = true } } // generate inventory file resource "local_file" "inventory" { - filename = "./hosts.yml" + filename = "./hosts.yml" directory_permission = "0755" file_permission = "0644" - content = < path='{{ item }}' follow=yes @@ -230,7 +230,7 @@ stat: path: "{{ item }}" register: rhel_08_6_2_9_audit - with_items: "{{ rhel9cis_passwd | selectattr('uid', '>=', min_int_uid | int ) | selectattr('uid', '!=', 65534) | map(attribute='dir') | list }}" + with_items: "{{ rhel9cis_passwd | selectattr('uid', '>=', min_int_uid | int ) | selectattr('uid', '<', max_int_uid | int ) | map(attribute='dir') | list }}" - name: "6.2.9 | AUDIT | Ensure all users' home directories exist" command: find -H {{ item.0 | quote }} -not -type l -perm /027 @@ -315,7 +315,7 @@ - name: "6.2.11 | AUDIT | Ensure users' home directories permissions are 750 or more restrictive" stat: path: "{{ item }}" - with_items: "{{ rhel9cis_passwd | selectattr('uid', '>=', min_int_uid | int ) | selectattr('uid', '!=', 65534) | map(attribute='dir') | list }}" + with_items: "{{ rhel9cis_passwd | selectattr('uid', '>=', min_int_uid | int ) | selectattr('uid', '<', max_int_uid | int ) | map(attribute='dir') | list }}" register: rhel_08_6_2_11_audit - name: "6.2.11 | AUDIT | Ensure users' home directories permissions are 750 or more restrictive" diff --git a/templates/ansible_vars_goss.yml.j2 b/templates/ansible_vars_goss.yml.j2 index 0947ce3..6654add 100644 --- a/templates/ansible_vars_goss.yml.j2 +++ b/templates/ansible_vars_goss.yml.j2 @@ -448,7 +448,7 @@ rhel9cis_nft_tables_autochaincreate: {{ rhel9cis_nft_tables_autochaincreate }} # Section 4 ## syslog -rhel9_cis_rsyslog: {{ rhel9cis_syslog }} +rhel9cis_syslog: {{ rhel9cis_preferred_log_capture }} # Section 5 ## 5.2.4 Note the following to understand precedence and layout