Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5071736
Merge pull request #2654 from codeenigma/Gitlab-stop-fix-PR-2.x
drazenCE Sep 2, 2025
a8ba8e4
Fixing-email-title-for-backup-validation (#2657)
matej5 Sep 4, 2025
057138d
Adding-task-to-create-aurora-cluster (#2659)
matej5 Sep 8, 2025
2b30a78
Fixing truthy variable mistakes. (#2662)
gregharvey Sep 10, 2025
cb63668
feat(php): Add FPM slow logrotate (#2625)
klausi Sep 10, 2025
9f05b90
r73458-install-php-gmp-by-default2 (#2667)
nfawbert Sep 10, 2025
a89ae45
Wazuh-mitre-report-setup (#2588)
drazenCE Sep 11, 2025
71278e9
Wazuh mitre report setup pr 2.x (#2669)
drazenCE Sep 11, 2025
65a6a0d
pin_ansible_version (#2671)
tymofiisobchenko Sep 12, 2025
854a245
Fixing-ce-provision-vars (#2678)
drazenCE Sep 16, 2025
1850230
Updating-string (#2507)
matej5 Sep 17, 2025
d62d4e6
Added-tasks-to-backup-Aurora-and-copy-AMI-to-safe-region (#2682)
matej5 Sep 18, 2025
6717286
SG-creation-update (#2605)
matej5 Sep 18, 2025
3bcee17
Fixing-copy-AMI-to-backup-region (#2684)
matej5 Sep 18, 2025
7bd773f
Fixing-ami-copy-task (#2686)
matej5 Sep 19, 2025
88851ce
Bug fixes pr 2.x (#2690)
gregharvey Sep 22, 2025
cf6129b
73569 allowing webp nginx pr 2.x (#2692)
filiprupic Sep 22, 2025
72021af
extending provision.sh to support tags in plays (#2431)
filiprupic Sep 24, 2025
e783690
Adding-option-for-Aurora-RDS-for-backup-validation (#2635)
matej5 Sep 24, 2025
572f4b0
Fixing-aws_vpc-override (#2688)
matej5 Sep 24, 2025
ef10642
Updating-pam-ldap-condition (#2695)
drazenCE Sep 24, 2025
e630bcb
Nslcd-nscd-restart (#2693)
drazenCE Sep 30, 2025
3a2b4b3
Fixing-varnish-pinning (#2710)
drazenCE Oct 1, 2025
6657bcc
Bug fixes pr 2.x (#2698)
gregharvey Oct 1, 2025
3986a6f
Adding-cyphers-nginx-template (#2679)
drazenCE Oct 1, 2025
dd4c3c9
Fixing-when-statement (#2700)
matej5 Oct 1, 2025
7cb9bae
Bug fixes pr 2.x (#2714)
gregharvey Oct 1, 2025
60a1d39
Bug fixes pr 2.x (#2717)
gregharvey Oct 1, 2025
b4485d4
Updating-aws-iam-tasks
Oct 2, 2025
970f01f
Resolving-conflicts
Oct 2, 2025
51fa46e
Updating-aws-backup-defaults
Oct 2, 2025
0a98661
Merge branch 'Updating-admin-tools-role' into Updating-admin-tools-ro…
Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/aws/aws_admin_tools/tasks/create_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
region: "{{ _aws_region }}"
targets:
- id: "{{ 'schedule_' + item.name }}"
arn: "{{ (aws_lambda._result['schedule_' + item.name].configuration.function_arn.split(':') | map('trim'))[:-1] | join(':') }}" # Remove the version number from ARN
arn: "arn:aws:lambda:{{ _aws_region }}:{{ _acc_id }}:function:{{ item.name }}"
register: _schedule_result

- name: Update Lambda policy.
Expand Down
4 changes: 4 additions & 0 deletions roles/aws/aws_admin_tools/tasks/lambda_iam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
managed_policies: "{{ _policies }}"
inline_policies: "{{ item.inline_policies | default(omit) }}"
policy_document: "{{ lookup('template', 'trust_lambda.j2') }}"

- name: Wait for 6 seconds for IAM to be ready.
ansible.builtin.wait_for:
timeout: 6
4 changes: 4 additions & 0 deletions roles/aws/aws_admin_tools/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
- "s3:GetObject"
policy_document: "{{ lookup('template', 'trust_apigateway.j2') }}"

- name: Wait for 6 seconds for IAM to be ready.
ansible.builtin.wait_for:
timeout: 6

- name: Configure Lambda IAM policies.
ansible.builtin.include_tasks: lambda_iam.yml
loop: "{{ _api_without_s3 }}"
Expand Down
4 changes: 4 additions & 0 deletions roles/aws/aws_backup/tasks/resource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
policy_document: backup
when: aws_backup.backup.iam_role_arn == "Default"

- name: Wait for 6 seconds for IAM to be ready.
ansible.builtin.wait_for:
timeout: 6

- name: Set IAM role ARN for backups.
ansible.builtin.set_fact:
_iam_role_arn: "{{ _aws_iam_role_result.iam_role.arn }}"
Expand Down
17 changes: 10 additions & 7 deletions roles/aws/aws_backup_validation/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
aws_backup_validation:
s3_bucket: "{{ _general_bucket }}"
s3_bucket_prefix: "backup-validation" # Prefix used for storing backup validation info
name: "RestoreValidation"
description: "Restore validation is running every Sunday at 00:00AM, and validation reporting is triggered on Monday 00:00AM"
timeout: 60
runtime: "python3.12"
main_file: "app"
handler: "lambda_handler"
git_url: example.git-url.codeenigma.com # Can be overwritten by git_url in item
resources:
- name: ec2_test_instance
git_url: true
git: true # if true, it will build git url to download repo
type: EC2
lambda_policy:
- "backup:PutRestoreValidationResult"
Expand All @@ -18,7 +19,7 @@ aws_backup_validation:
- "ssm:SendCommand"
- "ec2:DescribeInstances"
- name: rds_test_instance
git_url: true
git: true
type: RDS
lambda_policy:
- "backup:PutRestoreValidationResult"
Expand All @@ -27,12 +28,14 @@ aws_backup_validation:
- "ec2:DescribeInstances"
- "rds:DescribeDBInstances"
- name: aurora_create_instance
git_url: true
git: true
type: Aurora
lambda_policy:
- "lambda:InvokeFunction"
- "rds:DescribeDbClusters"
- "rds:CreateDbInstance"
- "rds:AddTagsToResource"
- name: aurora_test_instance
git_url: true
git: true
type: Aurora
event_pattern: '{ "source": ["aws.rds"], "detail-type": ["RDS DB Instance Event"], "resources": [{ "prefix": "arn:aws:rds:eu-west-1:{{ _acc_id }}:db:restoretest" }], "detail": { "EventID": ["RDS-EVENT-0005"] } }'
lambda_policy:
Expand All @@ -42,7 +45,7 @@ aws_backup_validation:
- "rds:DescribeDBClusters"
- "rds:DeleteDBInstance"
- name: validation_report
git_url: true
git: true
type: Schedule
schedule: "cron(0 0 ? * MON *)"
lambda_policy:
Expand Down
20 changes: 11 additions & 9 deletions roles/aws/aws_backup_validation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

- name: Setting previous command output into variable.
ansible.builtin.set_fact:
_acc_id: "{{ _acc_id.stdout | from_json }}"
_acc_id: "{{ _acc_id.stdout }}"

- name: Create a role and attach policies for events.
ansible.builtin.include_role:
name: aws/aws_iam_role
vars:
aws_iam_role:
name: "{{ item.name }}_event"
source: "{{ item.name}}"
source: "{{ item.name }}"
aws_profile: "{{ _aws_profile }}"
inline_policies:
name: "{{ item.name }}_event"
Expand All @@ -25,17 +25,14 @@
- "lambda:InvokeFunction"
policy_document: "{{ lookup('template', 'event_document_policy.json.j2') }}"
loop: "{{ aws_backup_validation.resources }}"
loop_control:
extended: true
extended_allitems: false

- name: Create a role and attach policies for Lambda functions.
ansible.builtin.include_role:
name: aws/aws_iam_role
vars:
aws_iam_role:
name: "{{ item.name}}_lambda"
source: "{{ item.name}}"
source: "{{ item.name }}"
aws_profile: "{{ _aws_profile }}"
managed_policies:
- arn:aws:iam::aws:policy/CloudWatchLogsFullAccess
Expand All @@ -45,9 +42,10 @@
action: "{{ item.lambda_policy }}"
policy_document: "{{ lookup('template', 'trusted_entitites.json.j2') }}"
loop: "{{ aws_backup_validation.resources }}"
loop_control:
extended: true
extended_allitems: false

- name: Wait for 6 seconds for IAM to be ready.
ansible.builtin.wait_for:
timeout: 6

- name: Get info about newly created restore testing plan.
ansible.builtin.command: >
Expand Down Expand Up @@ -107,6 +105,10 @@
- arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForBackup
- arn:aws:iam::aws:policy/service-role/AWSBackupServiceRolePolicyForRestores

- name: Wait for 6 seconds for IAM to be ready.
ansible.builtin.wait_for:
timeout: 6

# TODO: Not all clients have verified identity
#- name: Get verified domain.
# ansible.builtin.include_tasks: get_valid_email.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
- "lambda:GetFunction"
policy_document: "{{ lookup('template', 'lambda_policy.json') }}"

- name: Wait for 6 seconds for IAM to be ready.
ansible.builtin.wait_for:
timeout: 6

- name: Create Lambda function.
ansible.builtin.include_role:
name: aws/aws_lambda
Expand Down