ruby_ability_graph 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4ce5898e9ed11483ad4f291171ed863f3970738fae36bc25cd55d8d26c71036
4
- data.tar.gz: a2b269d8d48075ff220c25cf921b2f588e7126375b3d593cefe298404a4b3150
3
+ metadata.gz: 69091644aaeaacfb2c587e3e11ed70e0b27b575b1678f762f73fc39bec024406
4
+ data.tar.gz: ef060d9a0dea3f181596c4dd459c8fc847749ea1e06c30fe02cb6824d06b94bb
5
5
  SHA512:
6
- metadata.gz: 427d696904a000b007da7708227185fe6ce7daaa74582e59230c26f9d874f3c39e9beb68c4383dcfb6c83bb017d2cfa65327d30320363d8fc1cdbbbfddefed3e
7
- data.tar.gz: d1f77d2c37b35e6e3cb1f590e2858b521d6e2a30de2b6a388c1788a685115e9522a2b42077d3ea0493c6cd8e4bf0387a08ea681d9b3aa69814917d652c428f48
6
+ metadata.gz: fcd1d55fc2808d10063b16d67942a62458d2b183027214573d9dd3d8ec348a8cdbc9eb5da60a83b9c63ffa174f451130de17b1a872224c82c9a2058e0b0f3737
7
+ data.tar.gz: 44a8503733fad18260454e043be5d0053490e0a0aeca2b22ebaaef4671f064e8fce0d8a9d772eac5480c201662f4aaf669aebef1753112532522543458b8dbae
data/README.md CHANGED
@@ -1,15 +1,32 @@
1
1
  # ruby_ability_graph
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/ruby_ability_graph)](https://rubygems.org/gems/ruby_ability_graph)
4
+ [![CI](https://github.com/m1gd0n-dev/ruby-ability-graph/actions/workflows/ci.yml/badge.svg)](https://github.com/m1gd0n-dev/ruby-ability-graph/actions/workflows/ci.yml)
5
+ [![License: AGPL v3](https://img.shields.io/badge/license-AGPL--3.0--or--later-blue.svg)](LICENSE.txt)
6
+
3
7
  Loads a Rails app's [CanCanCan](https://github.com/CanCanCommunity/cancancan) `Ability` class in isolation and reports raw `can?`/`cannot?` results across every role x action x model combination -- so you can see who can access what without booting the full app or hand-tracing every conditional.
4
8
 
5
9
  **Status:** Each result is classified `resolved` (structured condition captured) or `unsupported` (declared but not analyzed, with a reason and source pointer). `scan` prints a human-readable table by default, a versioned JSON schema on request, can diff results against a simple policy file, and can render an interactive HTML graph of the whole thing.
6
10
 
11
+ Dogfooded against 4 real-world open-source Rails apps using CanCanCan:
12
+
13
+ | App | Resolved |
14
+ |---|---|
15
+ | [Fat Free CRM](https://github.com/fatfreecrm/fat_free_crm) | 88.9% |
16
+ | [Dradis CE](https://github.com/dradis/dradis-ce) | 86.4% |
17
+ | [Consul](https://github.com/consul/consul) | 99.5% |
18
+ | [Solidus](https://github.com/solidusio/solidus) | 96.8% |
19
+
7
20
  ## Installation
8
21
 
9
- Not on RubyGems yet -- point Bundler at the repo instead:
22
+ ```
23
+ gem install ruby_ability_graph
24
+ ```
25
+
26
+ Or add it to your Gemfile:
10
27
 
11
28
  ```ruby
12
- gem "ruby_ability_graph", github: "m1gd0n-dev/ruby-ability-graph"
29
+ gem "ruby_ability_graph"
13
30
  ```
14
31
 
15
32
  Requires Ruby >= 4.0 and a C compiler to install -- `prism` compiles a native extension at install time. The Rails app you're scanning doesn't need to be on Ruby 4, though -- point `--ruby-bin` at whatever Ruby that app runs on and the analysis subprocess uses that instead.
@@ -130,6 +147,8 @@ ruby-ability-graph scan APP_PATH --html-report report.html
130
147
 
131
148
  Writes a single, self-contained HTML file -- inlined CSS/JS, no server, no CDN assets, nothing fetched over the network -- showing an interactive role → action → resource graph. Hover a role to trace everything it can reach; hover an edge for the underlying condition and confidence. Edges are solid green where `resolved`, dashed amber where `unsupported`, and solid red where a `--policy-file` check (if given) found a violation. A coverage line at the top mirrors the table's resolved/total summary. Only `allowed: true` results become edges -- it's a "who can access what" diagram, not a dump of every denial.
132
149
 
150
+ ![Example HTML report graph](docs/images/html-report.png)
151
+
133
152
  Combine it with `--policy-file` to get violations highlighted directly on the graph, not just listed in the table/JSON output. The file opens straight from disk (`file://`) in any browser -- no need to serve it.
134
153
 
135
154
  ## Security
@@ -137,3 +156,7 @@ Combine it with `--policy-file` to get violations highlighted directly on the gr
137
156
  `scan` executes code in `APP_PATH` -- it loads your `Ability` class (and anything that file requires) in a subprocess. Only run it against apps you trust. `inspect` is static analysis only (via Prism) and never executes the target.
138
157
 
139
158
  `--html-report` makes no network requests, ever -- everything it needs is inlined into the one file it writes. It does embed your role names, action names, model names, and raw condition values into that file, though, so treat the generated report itself with the same care as the scan results: don't publish it somewhere untrusted people can read it if that data is sensitive.
159
+
160
+ ## License
161
+
162
+ AGPL-3.0-or-later. This is a CLI/library you run against your own `Ability` class as part of your own tooling (CI, local scans) -- it isn't a network service your users interact with, even when that pipeline runs in production. AGPL's network-copyleft clause (§13) is about modifying the program and offering the modified version to outside users over a network; running it, unmodified or modified, to scan your own codebase doesn't do that.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyAbilityGraph
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ability_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jessica Grider
@@ -26,8 +26,7 @@ dependencies:
26
26
  description: |
27
27
  ruby_ability_graph loads a Rails app's CanCanCan Ability class in isolation,
28
28
  enumerates roles x actions x models, and reports resolved permissions --
29
- distinguishing patterns it can fully resolve from ones it honestly flags as
30
- unsupported rather than guessing.
29
+ distinguishing patterns it can fully resolve from ones it doesn't support.
31
30
  executables:
32
31
  - ruby-ability-graph
33
32
  extensions: []
@@ -73,6 +72,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
72
  requirements: []
74
73
  rubygems_version: 4.0.16
75
74
  specification_version: 4
76
- summary: Maps CanCanCan authorization rules into a visual, queryable 'who can access
77
- what' model.
75
+ summary: Maps CanCanCan authorization rules into a visual 'who can access what' model.
78
76
  test_files: []