Files
hacktricks-cloud/pentesting-cloud/aws-security/aws-services/eventbridgescheduler-enum.md
2024-12-12 19:35:48 +01:00

108 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AWS - EventBridge Scheduler Enum
## EventBridge Scheduler
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
<details>
<summary>Support HackTricks</summary>
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
</details>
{% endhint %}
## EventBridge Scheduler
**Amazon EventBridge Scheduler** is a fully managed, **serverless scheduler designed to create, run, and manage tasks** at scale. It enables you to schedule millions of tasks across over 270 AWS services and 6,000+ API operations, all from a central service. With built-in reliability and no infrastructure to manage, EventBridge Scheduler simplifies scheduling, reduces maintenance costs, and scales automatically to meet demand. You can configure cron or rate expressions for recurring schedules, set one-time invocations, and define flexible delivery windows with retry options, ensuring tasks are reliably delivered based on the availability of downstream targets.
There is an initial limit of 1,000,000 schedules per region per account. Even the official quotas page suggests, "It's recommended to delete one-time schedules once they've completed."&#x20;
### Types of Schedules
Types of Schedules in EventBridge Scheduler:
1. **One-time schedules** Execute a task at a specific time, e.g., December 21st at 7 AM UTC.
2. **Rate-based schedules** Set recurring tasks based on a frequency, e.g., every 2 hours.
3. **Cron-based schedules** Set recurring tasks using a cron expression, e.g., every Friday at 4 PM.
Two Mechanisms for Handling Failed Events:
1. **Retry Policy** Defines the number of retry attempts for a failed event and how long to keep it unprocessed before considering it a failure.
2. **Dead-Letter Queue (DLQ)** A standard Amazon SQS queue where failed events are delivered after retries are exhausted. DLQs help in troubleshooting issues with your schedule or its downstream target.
### Targets
There are 2 types of targets for a scheduler [**templated (docs)**](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-templated.html), which are commonly used and AWS made them easier to configure, and [**universal (docs)**](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html), which can be used to call any AWS API.
**Templated targets** support the following services:
* CodeBuild StartBuild
* CodePipeline StartPipelineExecution
* Amazon ECS RunTask
* Parameters: EcsParameters
* EventBridge PutEvents
* Parameters: EventBridgeParameters
* Amazon Inspector StartAssessmentRun
* Kinesis PutRecord
* Parameters: KinesisParameters
* Firehose PutRecord
* Lambda Invoke
* SageMaker StartPipelineExecution
* Parameters: SageMakerPipelineParameters
* Amazon SNS Publish
* Amazon SQS SendMessage
* Parameters: SqsParameters
* Step Functions StartExecution
### Enumeration
```bash
# List all EventBridge Scheduler schedules
aws scheduler list-schedules
# List all EventBridge Scheduler schedule groups
aws scheduler list-schedule-groups
# Describe a specific schedule to retrieve more details
aws scheduler get-schedule --name <schedule_name>
# Describe a specific schedule group
aws scheduler get-schedule-group --name <group_name>
# List tags for a specific schedule (helpful in identifying any custom tags or permissions)
aws scheduler list-tags-for-resource --resource-arn <schedule_group_arn>
```
### Privesc
In the following page, you can check how to **abuse eventbridge scheduler permissions to escalate privileges**:
{% content-ref url="../aws-privilege-escalation/eventbridgescheduler-privesc.md" %}
[eventbridgescheduler-privesc.md](../aws-privilege-escalation/eventbridgescheduler-privesc.md)
{% endcontent-ref %}
## References
* [https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html)
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
<details>
<summary>Support HackTricks</summary>
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
</details>
{% endhint %}