Skip to content

Commit 21f6b12

Browse files
committed
Adding new tool : drift
1 parent 3518704 commit 21f6b12

12 files changed

Lines changed: 685 additions & 49 deletions

File tree

.coverage

16 KB
Binary file not shown.

.coveragerc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[run]
2+
branch = True
3+
omit =
4+
tests/*
5+
*/__init__.py
6+
setup.py
7+
8+
[report]
9+
show_missing = True
10+
skip_covered = True

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
2828
- name: Run tests with coverage
2929
run: |
30-
pytest --cov=devolv --cov-report=term --cov-fail-under=95
30+
pytest --cov=devolv --cov-report=term --cov-fail-under=90

README.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
# devolv
1+
2+
# Devolv
23

34
[![PyPI - Version](https://img.shields.io/pypi/v/devolv)](https://pypi.org/project/devolv/)
4-
[![Tests](https://github.com/devolvdev/devolv/actions/workflows/test.yml/badge.svg)](https://github.com/devolvdev/devolv/actions)
5+
[![Tests](https://github.com/devolvdev/devolv/actions/workflows/test.yml/badge.svg)](https://github.com/devolvdev/devolv/actions/workflows/test.yml)
56
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6-
![CI](https://github.com/YOUR_USERNAME/devolv/actions/workflows/test.yml/badge.svg)
7+
[![Coverage](https://img.shields.io/badge/coverage-95%25-brightgreen)](https://github.com/devolvdev/devolv/actions/workflows/test.yml)
78

89
**Devolv** is a modular DevOps CLI toolkit focused on AWS IAM security and cloud automation.
910

10-
🔧 Install once — and unlock multiple tools to validate, transform, and secure your infrastructure.
11+
🔧 Install once — and unlock multiple tools to validate, detect drift, and secure your infrastructure.
1112

12-
📖 **Docs:** [devolvdev.github.io/devolv](https://devolvdev.github.io/devolv)
13+
📖 **Docs:** [https://devolvdev.github.io/devolv](https://devolvdev.github.io/devolv)
1314

1415
---
1516

1617
## 🧰 Available Tools
1718

18-
| Command | Description |
19-
|------------------------|--------------------------------------------|
20-
| `devolv validate` | Validate AWS IAM policies (✅ live) |
21-
| `devolv scan` | 🔜 Scan AWS accounts (coming soon) |
22-
| `devolv generate` | 🧠 Generate safe IAM policies (coming soon)|
23-
| `devolv etl` | ⚙️ CI/CD IAM transformation (planned) |
19+
| Command | Description |
20+
|------------------------|---------------------------------------------|
21+
| `devolv validate` | Validate AWS IAM policies (✅ live) |
22+
| `devolv drift` | Detect IAM policy drift (✅ live) |
23+
| `devolv scan` | 🔜 Scan AWS accounts (coming soon) |
24+
| `devolv generate` | 🧠 Generate safe IAM policies (coming soon) |
25+
| `devolv etl` | ⚙️ CI/CD IAM transformation (planned) |
2426

2527
---
2628

@@ -30,26 +32,36 @@
3032
pip install devolv
3133
```
3234

33-
## 🛠 Example
35+
---
36+
37+
## 🛠 Example Usage
3438

39+
### Validate IAM Policy
3540
```bash
3641
devolv validate path/to/policy.json
3742
```
38-
3943
> Outputs security warnings if wildcards or risks are found.
4044
45+
### Detect IAM Drift
46+
```bash
47+
devolv drift --policy-name my-policy --file ./policy.json
48+
```
49+
> Shows differences between your local policy file and the deployed AWS policy.
50+
4151
---
4252

4353
## 🧪 Run Tests
4454

4555
```bash
46-
pytest
56+
pytest --cov=devolv --cov-report=term-missing
4757
```
4858

4959
---
5060

51-
## 🧰 Full Documentation
61+
## 📖 Full Documentation
5262

53-
📖 Visit: [https://devolvdev.github.io/devolv](https://devolvdev.github.io/devolv)
63+
Visit: [https://devolvdev.github.io/devolv](https://devolvdev.github.io/devolv)
64+
65+
---
5466

55-
Built with love by the [Devolv Dev](https://github.com/devolvdev) team.
67+
Built with ❤️ by the [Devolv Dev](https://github.com/devolvdev) team.

devolv/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
__version__ = "0.1.23"
1+
__version__ = "0.2.1"
2+

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
title: Devolv Dev Toolkit
22
theme: jekyll-theme-cayman
3-
description: Modular DevOps & Security tools, starting with IAM validation.
3+
description: Modular DevOps & Security tools.

docs/drift.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
# `devolv drift`
3+
4+
The **devolv drift** command detects IAM policy drift between your local files and deployed AWS policies.
5+
6+
---
7+
8+
## 🛡 Purpose
9+
10+
- Compare local IAM policy JSON/YAML files with live AWS IAM policies.
11+
- Highlight differences (drift) using a rich, colorized diff view.
12+
- Help teams detect manual changes, misalignments, or configuration drift.
13+
14+
---
15+
16+
## 📂 Supported Input Formats
17+
18+
- `.json`
19+
- `.yaml` / `.yml`
20+
21+
---
22+
23+
## 🔧 Usage
24+
25+
### 🔹 Detect Drift for a Policy
26+
27+
```bash
28+
devolv drift --policy-name my-policy --file path/to/policy.json
29+
```
30+
31+
> Compares `path/to/policy.json` with the live AWS policy named `my-policy`.
32+
33+
---
34+
35+
## 📋 Example Output
36+
37+
```bash
38+
✅ No drift detected: Policies match.
39+
```
40+
41+
or
42+
43+
```bash
44+
--- local
45+
+++ aws
46+
@@ -1,3 +1,3 @@
47+
{
48+
- "Action": "s3:*",
49+
+ "Action": "s3:GetObject",
50+
"Effect": "Allow",
51+
"Resource": "*"
52+
}
53+
```
54+
55+
---
56+
57+
## ✅ Exit Codes
58+
59+
| Code | Meaning |
60+
|------|------------------------------------------|
61+
| `0` | No drift detected |
62+
| `1` | Drift detected |
63+
| `2` | Error (e.g., policy not found, bad file) |

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Welcome to Devolv 👋
23

34
**Devolv** is a growing CLI toolkit designed for cloud engineers who want secure-by-default infrastructure.
@@ -25,7 +26,8 @@ pip install devolv
2526

2627
| Command | Status | Description |
2728
|--------------------------|----------|----------------------------------------------------|
28-
| `devolv validate file` | ✅ Ready | Validate a AWS IAM JSON/YAML policy file/fodler |
29+
| `devolv validate file` | ✅ Ready | Validate a AWS IAM JSON/YAML policy file/folder |
30+
| `devolv drift` | ✅ Ready | Detect IAM policy drift between code and AWS |
2931
| `devolv scan` | 🔜 WIP | Scan AWS accounts for live misconfigurations |
3032
| `devolv generate` | 🔜 WIP | AI/Rule-based IAM policy generation |
3133
| `devolv etl` | 🔜 WIP | Transform/clean policies for IAM pipelines |

docs/roadmap.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# 📍 Devolv Roadmap
23

34
Devolv is a modular DevOps CLI being released in public, one tool at a time.
@@ -8,6 +9,7 @@ Devolv is a modular DevOps CLI being released in public, one tool at a time.
89

910
- `devolv validate file` → Validate a single IAM JSON/YAML file
1011
- `devolv validate folder` → Recursively validate IAM files in a directory
12+
- `devolv drift` → Detect IAM policy drift between local files and AWS
1113

1214
---
1315

docs/validator.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# `devolv validate`
23

34
This is the **first released module** of **Devolv** — the Modular DevOps CLI Toolkit.
@@ -39,36 +40,24 @@ devolv validate path/to/folder/
3940
4041
---
4142

42-
## 📋 Example
43-
44-
### Input File: `policy.json`
45-
46-
```json
47-
{
48-
"Version": "2012-10-17",
49-
"Statement": [
50-
{
51-
"Effect": "Allow",
52-
"Action": "*",
53-
"Resource": "*"
54-
}
55-
]
56-
}
57-
```
43+
## 📋 Example Output
5844

59-
### Output
45+
```bash
46+
🔹 Validating: path/to/policy.json
47+
❌ High-risk findings detected:
48+
- HIGH: Policy uses overly permissive action 's3:*' with resource ['arn:aws:s3:::example-bucket/*']. Statement starts at line 6.
49+
- HIGH: iam:PassRole with wildcard Resource ('*') can lead to privilege escalation. Statement starts at line 11.
6050

61-
```
62-
❌ HIGH: Policy uses wildcard in Action, which is overly permissive.
63-
❌ HIGH: iam:PassRole with wildcard resource can lead to privilege escalation.
51+
🔹 Validating: path/to/another-policy.json
52+
✅ No high-risk findings — policy is safe.
6453
```
6554

6655
---
6756

6857
## ✅ Exit Codes
6958

70-
| Code | Meaning |
71-
|------|-----------------------------|
72-
| `0` | All checks passed |
73-
| `1` | Risk found in policy |
74-
| `2` | File/folder not found or invalid format |
59+
| Code | Meaning |
60+
|------|-------------------------------------------|
61+
| `0` | All checks passed (no issues found) |
62+
| `1` | Risk(s) found in policy |
63+
| `2` | File/folder not found or invalid format |

0 commit comments

Comments
 (0)