Skip to content

Commit b58cef1

Browse files
Merge pull request #1 from devanshbatham/rayder-v0.0.1-update
Rayder v0.0.2 update
2 parents 92b4c44 + be9195b commit b58cef1

File tree

4 files changed

+261
-212
lines changed

4 files changed

+261
-212
lines changed

README.md

Lines changed: 123 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@
1515
<a href="#workflows">Workflows</a>
1616
</p>
1717

18-
19-
![rayder](https://github.com/devanshbatham/rayder/blob/main/static/rayder.png?raw=true)
18+
![rayder](https://github.com/devanshbatham/rayder/blob/main/static/banner.png?raw=true)
2019

2120

2221
## About
2322

24-
Rayder is a command-line tool designed to simplify the orchestration and execution of workflows. It allows you to define a series of steps in a YAML file, each consisting of a command to be executed and optional output redirection. Rayder helps automate complex processes, making it easy to streamline repetitive tasks, and executing them parallelly if the commands do not depend on each other.
23+
Rayder is a command-line tool designed to simplify the orchestration and execution of workflows. It allows you to define a series of modules in a YAML file, each consisting of commands to be executed. Rayder helps you automate complex processes, making it easy to streamline repetitive modules and execute them parallelly if the commands do not depend on each other.
2524

2625
## Installation
2726

2827
To install Rayder, ensure you have Go (1.16 or higher) installed on your system. Then, run the following command:
2928

3029
```sh
31-
go install github.com/devanshbatham/rayder@latest
30+
go install github.com/devanshbatham/rayder@v0.0.2
3231
```
3332

3433
## Usage
@@ -44,47 +43,142 @@ rayder -w path/to/workflow.yaml
4443
A workflow is defined in a YAML file with the following structure:
4544

4645
```yaml
47-
workflow: workflow-name
46+
vars:
47+
VAR_NAME: value
48+
# Add more variables...
49+
4850
parallel: true|false
49-
silent: true|false
50-
output-dir: output-directory
51-
output-file: workflow.log
52-
steps:
53-
step-1: command-1
54-
step-2: command-2
55-
# Add more steps...
51+
modules:
52+
- name: task-name
53+
cmds:
54+
- command-1
55+
- command-2
56+
# Add more commands...
57+
silent: true|false
58+
# Add more modules...
5659
```
5760

61+
## Using Variables in Workflows
62+
63+
Rayder allows you to use variables in your workflow configuration, making it easy to parameterize your commands and achieve more flexibility. You can define variables in the `vars` section of your workflow YAML file. These variables can then be referenced within your command strings using double curly braces (`{{}}`).
5864

59-
## Example workflow with placeholder
65+
### Defining Variables
66+
67+
To define variables, add them to the `vars` section of your workflow YAML file:
6068

6169
```yaml
62-
workflow: reverse-whois
63-
parallel: false
64-
silent: true
65-
output-dir: results
66-
output-file: workflow.log
67-
steps:
68-
step-1: revwhoix -k "<<ORG>>" > results/root-domains.txt
69-
step-2: xargs -I {} -a results/root-domains.txt echo "subfinder -d {} -o {}.out" | quaithe -workers 30 -silent
70-
step-3: cat *.out > results/root-subdomains.txt
71-
step-4: rm *.out
72-
step-5: cat results/root-subdomains.txt | dnsx -silent -threads 100 -o results/resolved-subdomains.txt
70+
vars:
71+
VAR_NAME: value
72+
ANOTHER_VAR: another_value
73+
# Add more variables...
74+
```
75+
76+
### Referencing Variables in Commands
77+
78+
You can reference variables within your command strings using double curly braces (`{{}}`). For example, if you defined a variable `OUTPUT_DIR`, you can use it like this:
79+
80+
```yaml
81+
modules:
82+
- name: example-task
83+
cmds:
84+
- echo "Output directory: {{OUTPUT_DIR}}"
7385
```
7486
75-
To be executed as:
87+
### Supplying Variables via the Command Line
88+
89+
You can also supply values for variables via the command line when executing your workflow. Use the format `VARIABLE_NAME=value` to provide values for specific variables. For example:
7690

7791
```sh
78-
rayder -w workflow.yaml -p '{"ORG":"Yelp, Inc"}'
92+
rayder -w path/to/workflow.yaml VAR_NAME=new_value ANOTHER_VAR=updated_value
7993
```
8094

95+
If you don't provide values for variables via the command line, Rayder will automatically apply default values defined in the `vars` section of your workflow YAML file.
8196

97+
Remember that variables supplied via the command line will override the default values defined in the YAML configuration.
8298

83-
## Parallel Execution
99+
## Example
100+
101+
### Example 1:
102+
103+
Here's an example of how you can define, reference, and supply variables in your workflow configuration:
104+
105+
```yaml
106+
vars:
107+
ORG: "example.org"
108+
OUTPUT_DIR: "results"
109+
110+
modules:
111+
- name: example-task
112+
cmds:
113+
- echo "Organization: {{ORG}}"
114+
- echo "Output directory: {{OUTPUT_DIR}}"
115+
```
116+
117+
When executing the workflow, you can provide values for `ORG` and `OUTPUT_DIR` via the command line like this:
84118

85-
The `parallel` field in the workflow configuration determines whether steps should be executed in parallel or sequentially. Setting `parallel` to `true` allows steps to run concurrently, making it suitable for tasks with no dependencies. When set to `false`, steps will execute one after another.
119+
```sh
120+
rayder -w path/to/workflow.yaml ORG=custom_org OUTPUT_DIR=custom_results_dir
121+
```
86122

123+
This will override the default values and use the provided values for these variables.
124+
125+
126+
127+
128+
### Example 2:
129+
130+
Here's an example workflow configuration tailored for reverse whois recon and processing the root domains into subdomains, resolving them and checking which ones are alive:
131+
132+
```yaml
133+
vars:
134+
ORG: "Acme, Inc"
135+
OUTPUT_DIR: "results-dir"
136+
137+
parallel: false
138+
modules:
139+
- name: reverse-whois
140+
silent: false
141+
cmds:
142+
- mkdir -p {{OUTPUT_DIR}}
143+
- revwhoix -k "{{ORG}}" > {{OUTPUT_DIR}}/root-domains.txt
144+
145+
- name: finding-subdomains
146+
cmds:
147+
- xargs -I {} -a {{OUTPUT_DIR}}/root-domains.txt echo "subfinder -d {} -o {}.out" | quaithe -workers 30
148+
silent: false
149+
150+
- name: cleaning-subdomains
151+
cmds:
152+
- cat *.out > {{OUTPUT_DIR}}/root-subdomains.txt
153+
- rm *.out
154+
silent: true
155+
156+
- name: resolving-subdomains
157+
cmds:
158+
- cat {{OUTPUT_DIR}}/root-subdomains.txt | dnsx -silent -threads 100 -o {{OUTPUT_DIR}}/resolved-subdomains.txt
159+
silent: false
160+
161+
- name: checking-alive-subdomains
162+
cmds:
163+
- cat {{OUTPUT_DIR}}/resolved-subdomains.txt | httpx -silent -threads 1000 -o {{OUTPUT_DIR}}/alive-subdomains.txt
164+
silent: false
165+
```
166+
167+
## Executing the Example Workflow
168+
169+
To execute the above workflow, run the following command:
170+
171+
```sh
172+
rayder -w path/to/bugbounty.yaml ORG="Yelp, Inc" OUTPUT_DIR=results
173+
```
174+
175+
## Parallel Execution
176+
177+
The `parallel` field in the workflow configuration determines whether modules should be executed in parallel or sequentially. Setting `parallel` to `true` allows modules to run concurrently, making it suitable for modules with no dependencies. When set to `false`, modules will execute one after another.
87178

88179
## Workflows
89180

90-
A collection of [Rayder workflows](https://github.com/devanshbatham/rayder-workflows) to be publish soon. Stay tuned..
181+
Explore a collection of sample workflows and examples in the [Rayder workflows repository](https://github.com/devanshbatham/rayder-workflows). Stay tuned for more additions!
182+
183+
## Inspiration
184+
Inspiration of this project comes from Awesome [taskfile](https://taskfile.dev/) project.

0 commit comments

Comments
 (0)