diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md index 90b0fc558..e62b94d5b 100644 --- a/docs/_Sidebar.md +++ b/docs/_Sidebar.md @@ -9,6 +9,7 @@ - [AWS AMI ASG Cleanup](/roles/aws/aws_ami_asg_cleanup) - [AWS AMI](/roles/aws/aws_ami) - [AWS Backup](/roles/aws/aws_backup) + - [AWS Backup Validation](/roles/aws/aws_backup_validation) - [AWS CloudFront distribution](/roles/aws/aws_cloudfront_distribution) - [Cloudwatch log group](/roles/aws/aws_cloudwatch_log_group) - [Amazon credentials](/roles/aws/aws_credentials) @@ -23,6 +24,7 @@ - [AWS OpenSearch](/roles/aws/aws_opensearch) - [AWS key pair.](/roles/aws/aws_provision_ec2_keypair) - [AWS RDS](/roles/aws/aws_rds) + - [AWS Resource Group.](/roles/aws/aws_resource_group) - [AWS S3 Bucket](/roles/aws/aws_s3_bucket) - [AWS Security Groups](/roles/aws/aws_security_groups) - [AWS SNS](/roles/aws/aws_sns) diff --git a/docs/roles/aws/aws_backup_validation.md b/docs/roles/aws/aws_backup_validation.md new file mode 100644 index 000000000..3548fc7b0 --- /dev/null +++ b/docs/roles/aws/aws_backup_validation.md @@ -0,0 +1,25 @@ +# AWS Backup Validation + +Creates AWS Restore testing plan for EC2 and RDS, EventBridge rule that gets triggered by restore testing and Lambda backup validation that will check and notify about the restored instance. + + + + + +## Default variables +```yaml +--- +aws_backup_validation: + name: "RestoreValidation" + description: "Restore validation for" + timeout: 60 + runtime: "python3.12" + handler: "lambda_handler" + resources: + - EC2 + - RDS + #- EFS + +``` + + diff --git a/docs/roles/aws/aws_resource_group.md b/docs/roles/aws/aws_resource_group.md new file mode 100644 index 000000000..116ab32e4 --- /dev/null +++ b/docs/roles/aws/aws_resource_group.md @@ -0,0 +1,7 @@ +# AWS Resource Group. +Creates a Resource Group based on Environment and resource that is getting built. Once the resource group is created, AWS will automatically add or remove resources from groups. + + + + + diff --git a/docs/roles/debian/wazuh.md b/docs/roles/debian/wazuh.md index 7f4234057..1ead6377f 100644 --- a/docs/roles/debian/wazuh.md +++ b/docs/roles/debian/wazuh.md @@ -94,7 +94,20 @@ wazuh: wazuh_manager_email_log_source: alerts.log wazuh_manager_log_level: 3 wazuh_manager_email_level: 12 - wazuh_manager_whitelist: 1.1.1.1 + wazuh_manager_config: + active_responses: + - command: "firewall-drop" + location: "all" + rules_id: "31151,5712,104130,101071,101132,101238,101251,103011" + repeated_offenders: "30,60,120" + timeout: 600 + - command: "firewall-drop" + location: "all" + rules_id: "100205" + repeated_offenders: "30,60,120" + timeout: 3600 + wazuh_manager_globals: + - '1.1.1.1' agent_groups: [] # maps to `groups` string in agent config above wazuh_manager_extra_emails: [] # list of additional emails to send, e.g. #- enable: true diff --git a/roles/aws/aws_backup/tasks/main.yml b/roles/aws/aws_backup/tasks/main.yml index b96202953..5da2d0a14 100644 --- a/roles/aws/aws_backup/tasks/main.yml +++ b/roles/aws/aws_backup/tasks/main.yml @@ -66,6 +66,6 @@ loop_var: plan when: aws_backup.plans | length -- name: Include backup validation role. +- name: Include aws backup validation role. ansible.builtin.include_role: name: aws/aws_backup_validation diff --git a/roles/aws/aws_backup_validation/README.md b/roles/aws/aws_backup_validation/README.md new file mode 100644 index 000000000..3548fc7b0 --- /dev/null +++ b/roles/aws/aws_backup_validation/README.md @@ -0,0 +1,25 @@ +# AWS Backup Validation + +Creates AWS Restore testing plan for EC2 and RDS, EventBridge rule that gets triggered by restore testing and Lambda backup validation that will check and notify about the restored instance. + + + + + +## Default variables +```yaml +--- +aws_backup_validation: + name: "RestoreValidation" + description: "Restore validation for" + timeout: 60 + runtime: "python3.12" + handler: "lambda_handler" + resources: + - EC2 + - RDS + #- EFS + +``` + + diff --git a/roles/aws/aws_backup_validation/defaults/main.yml b/roles/aws/aws_backup_validation/defaults/main.yml index ae70325f3..0ae695134 100644 --- a/roles/aws/aws_backup_validation/defaults/main.yml +++ b/roles/aws/aws_backup_validation/defaults/main.yml @@ -1,9 +1,9 @@ --- aws_backup_validation: - name: 'RestoreValidation' - description: 'Restore validation for' + name: "RestoreValidation" + description: "Restore validation for" timeout: 60 - runtime: python3.12 + runtime: "python3.12" handler: "lambda_handler" resources: - EC2 diff --git a/roles/aws/aws_backup_validation/tasks/main.yml b/roles/aws/aws_backup_validation/tasks/main.yml index 3e45d2d91..d09acd6d1 100644 --- a/roles/aws/aws_backup_validation/tasks/main.yml +++ b/roles/aws/aws_backup_validation/tasks/main.yml @@ -2,7 +2,7 @@ - name: Create a role and attach policies amazon.aws.iam_role: name: LambdaBackupRestoreRole - assume_role_policy_document: "{{ lookup('file','trusted_entitites.j2') }}" + assume_role_policy_document: "{{ lookup('file', 'trusted_entitites.j2') }}" managed_policies: - arn:aws:iam::aws:policy/AmazonEC2FullAccess - arn:aws:iam::aws:policy/service-role/AmazonEFSCSIDriverPolicy @@ -25,7 +25,7 @@ - name: Update AWSBackupDefaultServiceRole amazon.aws.iam_role: name: AWSBackupDefaultServiceRole - assume_role_policy_document: "{{ lookup('file','pass_role_backup.j2') }}" + assume_role_policy_document: "{{ lookup('file', 'pass_role_backup.j2') }}" managed_policies: - arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup - arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForRestores diff --git a/roles/aws/aws_resource_group/README.md b/roles/aws/aws_resource_group/README.md new file mode 100644 index 000000000..116ab32e4 --- /dev/null +++ b/roles/aws/aws_resource_group/README.md @@ -0,0 +1,7 @@ +# AWS Resource Group. +Creates a Resource Group based on Environment and resource that is getting built. Once the resource group is created, AWS will automatically add or remove resources from groups. + + + + + diff --git a/roles/debian/wazuh/README.md b/roles/debian/wazuh/README.md index 7f4234057..1ead6377f 100644 --- a/roles/debian/wazuh/README.md +++ b/roles/debian/wazuh/README.md @@ -94,7 +94,20 @@ wazuh: wazuh_manager_email_log_source: alerts.log wazuh_manager_log_level: 3 wazuh_manager_email_level: 12 - wazuh_manager_whitelist: 1.1.1.1 + wazuh_manager_config: + active_responses: + - command: "firewall-drop" + location: "all" + rules_id: "31151,5712,104130,101071,101132,101238,101251,103011" + repeated_offenders: "30,60,120" + timeout: 600 + - command: "firewall-drop" + location: "all" + rules_id: "100205" + repeated_offenders: "30,60,120" + timeout: 3600 + wazuh_manager_globals: + - '1.1.1.1' agent_groups: [] # maps to `groups` string in agent config above wazuh_manager_extra_emails: [] # list of additional emails to send, e.g. #- enable: true