Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release (Date-based)

on:
schedule:
- cron: '0 12 * * 1'
workflow_dispatch:

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true

- name: Create Release
uses: runwhen-contrib/github-actions/generate-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
displayUnitsShort: ok
locations:
- {{default_location}}
description: Count AWS ACM certificates that are unused, expiring, expired, or failed in AWS region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
description: Count AWS ACM certificates that are unused, expiring, expired, or failed in AWS region {{match_resource.resource.region}} and account {{match_resource.account_name}}
codeBundle:
{% if repo_url %}
repoUrl: {{repo_url}}
Expand All @@ -31,6 +31,8 @@ spec:
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{match_resource.resource.account_id}}"
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
secretsProvided:
{% include "aws-auth.yaml" ignore missing %}
alerts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
{% include "common-annotations.yaml" %}
spec:
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/aws/certificate_manager.svg
alias: AWS ACM Health For Region {{match_resource.resource.region}} in Account {{match_resource.resource.account_id}}
asMeasuredBy: The number of AWS ACM certificates that are unused, expiring or expired and failed status in region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
alias: AWS ACM Health For Region {{match_resource.resource.region}} in Account {{match_resource.account_name}}
asMeasuredBy: The number of AWS ACM certificates that are unused, expiring or expired and failed status in region {{match_resource.resource.region}} and account {{match_resource.account_name}}
configProvided:
- name: SLX_PLACEHOLDER
value: SLX_PLACEHOLDER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ spec:
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{match_resource.resource.account_id}}"
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
secretsProvided:
{% include "aws-auth.yaml" ignore missing %}
15 changes: 10 additions & 5 deletions codebundles/aws-c7n-acm-health/runbook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Library CloudCustodian.Core
Suite Setup Suite Initialization

*** Tasks ***
List Unused ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
List Unused ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find unused ACM certificates
[Tags] aws acm certificate security data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -54,7 +54,7 @@ List Unused ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS
RW.Core.Add Pre To Report No unused ACM certificates found in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
END

List Expiring ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
List Expiring ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find Expiring ACM certificates
[Tags] aws acm certificate expiration data:config
CloudCustodian.Core.Generate Policy
Expand Down Expand Up @@ -100,7 +100,7 @@ List Expiring ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${A
RW.Core.Add Pre To Report No ACM certificates nearing expiration found in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
END

List Expired ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
List Expired ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find expired ACM certificates
[Tags] aws acm certificate expiration data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -141,7 +141,7 @@ List Expired ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AW
RW.Core.Add Pre To Report No expired ACM certificates found in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
END

List Failed Status ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
List Failed Status ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find failed status ACM certificates
[Tags] aws acm certificate status data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -183,7 +183,7 @@ List Failed Status ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account
RW.Core.Add Pre To Report No ACM certificates in failed status found in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
END

List Pending Validation ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
List Pending Validation ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find pending validation ACM certificates
[Tags] aws acm certificate status data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -236,6 +236,10 @@ Suite Initialization
... type=string
... description=AWS Account ID
... pattern=\w*
${AWS_ACCOUNT_NAME}= RW.Core.Import User Variable AWS_ACCOUNT_NAME
... type=string
... description=AWS Account Name
... pattern=\w*
${aws_credentials}= RW.Core.Import Secret aws_credentials
... type=string
... description=AWS credentials from the workspace (from aws-auth block; e.g. aws:access_key@cli, aws:irsa@cli).
Expand All @@ -250,6 +254,7 @@ Suite Initialization
Set Suite Variable ${AWS_REGION} ${AWS_REGION}
Set Suite Variable ${CERT_EXPIRY_DAYS} ${CERT_EXPIRY_DAYS}
Set Suite Variable ${AWS_ACCOUNT_ID} ${AWS_ACCOUNT_ID}
Set Suite Variable ${AWS_ACCOUNT_NAME} ${AWS_ACCOUNT_NAME}
Set Suite Variable ${aws_credentials} ${aws_credentials}
# AWS credentials are provided by the platform from the aws-auth block (runwhen-local);
# the runtime uses aws_utils to set up the auth environment (IRSA, access key, assume role, etc.).
Expand Down
15 changes: 10 additions & 5 deletions codebundles/aws-c7n-acm-health/sli.robot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Library CloudCustodian.Core
Suite Setup Suite Initialization

*** Tasks ***
Check for unused ACM certificates in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_ID}`
Check for unused ACM certificates in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_NAME}`
[Documentation] Find unused ACM certificates
[Tags] aws acm certificate security data:config
${c7n_output}= RW.CLI.Run Cli
Expand All @@ -23,7 +23,7 @@ Check for unused ACM certificates in AWS Region `${AWS_REGION}` in AWS account `
${unused_certificate_score}= Evaluate 1 if int(${count.stdout}) <= int(${MAX_UNUSED_CERTIFICATES}) else 0
Set Global Variable ${unused_certificate_score}

Check for Expiring ACM certificates in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_ID}`
Check for Expiring ACM certificates in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_NAME}`
[Documentation] Find Expiring ACM certificates
[Tags] aws acm certificate expiration data:config
CloudCustodian.Core.Generate Policy
Expand All @@ -37,7 +37,7 @@ Check for Expiring ACM certificates in AWS Region `${AWS_REGION}` in AWS account
${expiring_certificate_score}= Evaluate 1 if int(${count.stdout}) <= int(${MAX_EXPIRING_CERTIFICATES}) else 0
Set Global Variable ${expiring_certificate_score}

Check for expired ACM certificates in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_ID}`
Check for expired ACM certificates in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_NAME}`
[Documentation] Find expired ACM certificates
[Tags] aws acm certificate expiration data:config
${c7n_output}= RW.CLI.Run Cli
Expand All @@ -48,7 +48,7 @@ Check for expired ACM certificates in AWS Region `${AWS_REGION}` in AWS account
${expired_certificate_score}= Evaluate 1 if int(${count.stdout}) <= int(${MAX_EXPIRED_CERTIFICATES}) else 0
Set Global Variable ${expired_certificate_score}

Check for Failed Status ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
Check for Failed Status ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find failed status ACM certificates
[Tags] aws acm certificate status data:config
${c7n_output}= RW.CLI.Run Cli
Expand All @@ -59,7 +59,7 @@ Check for Failed Status ACM Certificates in AWS Region `${AWS_REGION}` in AWS Ac
${failed_certificate_score}= Evaluate 1 if int(${count.stdout}) <= int(${MAX_FAILED_CERTIFICATES}) else 0
Set Global Variable ${failed_certificate_score}

Check for Pending Validation ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_ID}`
Check for Pending Validation ACM Certificates in AWS Region `${AWS_REGION}` in AWS Account `${AWS_ACCOUNT_NAME}`
[Documentation] Find pending validation ACM certificates
[Tags] aws acm certificate validation data:config
${c7n_output}= RW.CLI.Run Cli
Expand All @@ -85,6 +85,10 @@ Suite Initialization
... type=string
... description=AWS Account ID
... pattern=\w*
${AWS_ACCOUNT_NAME}= RW.Core.Import User Variable AWS_ACCOUNT_NAME
... type=string
... description=AWS Account Name
... pattern=\w*
${aws_credentials}= RW.Core.Import Secret aws_credentials
... type=string
... description=AWS credentials from the workspace (from aws-auth block; e.g. aws:access_key@cli, aws:irsa@cli).
Expand Down Expand Up @@ -128,6 +132,7 @@ Suite Initialization
${clean_workding_dir}= RW.CLI.Run Cli cmd=rm -rf ${OUTPUT_DIR}/aws-c7n-acm-health
Set Suite Variable ${AWS_REGION} ${AWS_REGION}
Set Suite Variable ${AWS_ACCOUNT_ID} ${AWS_ACCOUNT_ID}
Set Suite Variable ${AWS_ACCOUNT_NAME} ${AWS_ACCOUNT_NAME}
Set Suite Variable ${CERT_EXPIRY_DAYS} ${CERT_EXPIRY_DAYS}
Set Suite Variable ${MAX_UNUSED_CERTIFICATES} ${MAX_UNUSED_CERTIFICATES}
Set Suite Variable ${MAX_FAILED_CERTIFICATES} ${MAX_FAILED_CERTIFICATES}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
displayUnitsShort: ok
locations:
- {{default_location}}
description: Measures security and health of AWS EBS volumes in AWS region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
description: Measures security and health of AWS EBS volumes in AWS region {{match_resource.resource.region}} and account {{match_resource.account_name}}
codeBundle:
{% if repo_url %}
repoUrl: {{repo_url}}
Expand All @@ -31,6 +31,8 @@ spec:
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{match_resource.resource.account_id}}"
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
secretsProvided:
{% include "aws-auth.yaml" ignore missing %}
alerts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
{% include "common-annotations.yaml" %}
spec:
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/aws/Resource-Icons_06072024/Res_Storage/Res_Amazon-Elastic-Block-Store_Multiple-Volumes_48.png
alias: AWS EBS Health For Region {{match_resource.resource.region}} in Account {{match_resource.resource.account_id}}
asMeasuredBy: The number of AWS EBS volumes and snapshots in region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
alias: AWS EBS Health For Region {{match_resource.resource.region}} in Account {{match_resource.account_name}}
asMeasuredBy: The number of AWS EBS volumes and snapshots in region {{match_resource.resource.region}} and account {{match_resource.account_name}}
configProvided:
- name: SLX_PLACEHOLDER
value: SLX_PLACEHOLDER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ spec:
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{match_resource.resource.account_id}}"
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
secretsProvided:
{% include "aws-auth.yaml" ignore missing %}
14 changes: 8 additions & 6 deletions codebundles/aws-c7n-ebs-health/runbook.robot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Suite Setup Suite Initialization


*** Tasks ***
List Unattached EBS Volumes in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_ID}`
List Unattached EBS Volumes in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_NAME}`
[Documentation] Check for unattached EBS volumes in the specified region.
[Tags] ebs storage aws volume unattached data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -51,7 +51,7 @@ List Unattached EBS Volumes in AWS Region `${AWS_REGION}` in AWS account `${AWS_
END


List Unencrypted EBS Volumes in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_ID}`
List Unencrypted EBS Volumes in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_NAME}`
[Documentation] Check for Unencrypted EBS Volumes in the specified region.
[Tags] ebs storage aws volume encryption data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -88,7 +88,7 @@ List Unencrypted EBS Volumes in AWS Region `${AWS_REGION}` in AWS account `${AWS
END


List Unused EBS Snapshots in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_ID}`
List Unused EBS Snapshots in AWS Region `${AWS_REGION}` in AWS account `${AWS_ACCOUNT_NAME}`
[Documentation] Check for Unused EBS Snapshots in the specified region.
[Tags] ebs storage aws volume unused data:config
${c7n_output}= RW.CLI.Run Cli
Expand Down Expand Up @@ -134,16 +134,18 @@ Suite Initialization
... type=string
... description=AWS Account ID
... pattern=\w*
${AWS_ACCOUNT_NAME}= RW.Core.Import User Variable AWS_ACCOUNT_NAME
... type=string
... description=AWS Account Name
... pattern=\w*
${aws_credentials}= RW.Core.Import Secret aws_credentials
... type=string
... description=AWS credentials from the workspace (from aws-auth block; e.g. aws:access_key@cli, aws:irsa@cli).
... pattern=\w*
${aws_account_name_query}= RW.CLI.Run Cli
... cmd=aws organizations describe-account --account-id $(aws sts get-caller-identity --query 'Account' --output text) --query "Account.Name" --output text | tr -d '\n'
${clean_workding_dir}= RW.CLI.Run Cli cmd=rm -rf ${OUTPUT_DIR}/aws-c7n-ebs-health # Note: Clean out the cloud custoding report dir to ensure accurate data
Set Suite Variable ${AWS_ACCOUNT_NAME} ${aws_account_name_query.stdout}
Set Suite Variable ${AWS_REGION} ${AWS_REGION}
Set Suite Variable ${AWS_ACCOUNT_ID} ${AWS_ACCOUNT_ID}
Set Suite Variable ${AWS_ACCOUNT_NAME} ${AWS_ACCOUNT_NAME}
Set Suite Variable ${aws_credentials} ${aws_credentials}
# AWS credentials are provided by the platform from the aws-auth block (runwhen-local);
# the runtime uses aws_utils to set up the auth environment (IRSA, access key, assume role, etc.).
Expand Down
5 changes: 5 additions & 0 deletions codebundles/aws-c7n-ebs-health/sli.robot
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Suite Initialization
... type=string
... description=AWS Account ID
... pattern=\w*
${AWS_ACCOUNT_NAME}= RW.Core.Import User Variable AWS_ACCOUNT_NAME
... type=string
... description=AWS Account Name
... pattern=\w*
${aws_credentials}= RW.Core.Import Secret aws_credentials
... type=string
... description=AWS credentials from the workspace (from aws-auth block; e.g. aws:access_key@cli, aws:irsa@cli).
Expand All @@ -80,6 +84,7 @@ Suite Initialization
${clean_workding_dir}= RW.CLI.Run Cli cmd=rm -rf ${OUTPUT_DIR}/aws-c7n-ebs-health # Note: Clean out the cloud custoding report dir to ensure accurate data
Set Suite Variable ${AWS_REGION} ${AWS_REGION}
Set Suite Variable ${AWS_ACCOUNT_ID} ${AWS_ACCOUNT_ID}
Set Suite Variable ${AWS_ACCOUNT_NAME} ${AWS_ACCOUNT_NAME}
Set Suite Variable ${EVENT_THRESHOLD} ${EVENT_THRESHOLD}
Set Suite Variable ${SECURITY_EVENT_THRESHOLD} ${SECURITY_EVENT_THRESHOLD}
Set Suite Variable ${aws_credentials} ${aws_credentials}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
displayUnitsShort: ok
locations:
- {{default_location}}
description: Count the number of EC2 instances that are stale or stopped in this AWS region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
description: Count the number of EC2 instances that are stale or stopped in this AWS region {{match_resource.resource.region}} and account {{match_resource.account_name}}
codeBundle:
{% if repo_url %}
repoUrl: {{repo_url}}
Expand All @@ -31,6 +31,8 @@ spec:
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{match_resource.resource.account_id}}"
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
- name: AWS_EC2_AGE
value: '60'
- name: AWS_EC2_TAGS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ metadata:
{% include "common-annotations.yaml" %}
spec:
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/aws/Resource-Icons_06072024/Res_Compute/Res_Amazon-EC2_Instances_48.svg
alias: AWS EC2 Health For Region {{match_resource.resource.region}} in Account {{match_resource.resource.account_id}}
asMeasuredBy: The number of stale and stopped EC2 instances in region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
alias: AWS EC2 Health For Region {{match_resource.resource.region}} in Account {{match_resource.account_name}}
asMeasuredBy: The number of stale and stopped EC2 instances in region {{match_resource.resource.region}} and account {{match_resource.account_name}}
configProvided:
- name: SLX_PLACEHOLDER
value: SLX_PLACEHOLDER
owners:
- {{workspace.owner_email}}
statement: Identify stale and stopped EC2 instances that may pose security risks due to missed updates or inactivity in the region {{match_resource.resource.region}} and account {{match_resource.resource.account_id}}
statement: Identify stale and stopped EC2 instances that may pose security risks due to missed updates or inactivity in the region {{match_resource.resource.region}} and account {{match_resource.account_name}}
additionalContext:
{% include "aws-hierarchy.yaml" ignore missing %}
qualified_name: "{{ match_resource.qualified_name | replace(":", "_") }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ spec:
value: "{{match_resource.resource.region}}"
- name: AWS_ACCOUNT_ID
value: "{{match_resource.resource.account_id}}"
- name: AWS_ACCOUNT_NAME
value: "{{match_resource.account_name}}"
- name: AWS_EC2_AGE
value: '60'
- name: AWS_EC2_TAGS
Expand Down
Loading