aws-why 0.1.0__py3-none-win_amd64.whl

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.
Binary file
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: aws-why
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Environment :: Console
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Intended Audience :: System Administrators
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: MacOS
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Rust
13
+ Classifier: Topic :: Security
14
+ Classifier: Topic :: System :: Systems Administration
15
+ License-File: LICENSE
16
+ Summary: Run AWS CLI commands and explain authorization failures with evidence
17
+ Keywords: aws,iam,cli,security,authorization
18
+ Home-Page: https://github.com/kraftaa/aws-why
19
+ License-Expression: MIT
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
22
+ Project-URL: Documentation, https://github.com/kraftaa/aws-why#readme
23
+ Project-URL: Issues, https://github.com/kraftaa/aws-why/issues
24
+ Project-URL: Source, https://github.com/kraftaa/aws-why
25
+
26
+ # aws-why
27
+
28
+ `aws-why` runs an AWS CLI command unchanged. If the command fails, it classifies the failure and explains an authorization denial using the strongest evidence AWS made available.
29
+
30
+ ```console
31
+ $ aws-why run -- aws s3 cp test.csv s3://prod-data/test.csv
32
+ upload failed: ... AccessDenied ...
33
+
34
+ ACCESS DENIED
35
+
36
+ Identity
37
+ account: 123456789012
38
+ principal: DataEngineer
39
+ session: example-session
40
+
41
+ Failed operation
42
+ s3:PutObject
43
+
44
+ Resource
45
+ arn:aws:s3:::prod-data/test.csv
46
+
47
+ Cause
48
+ a permissions boundary blocks the action
49
+
50
+ Evidence
51
+ AWS error response (reported by AWS)
52
+ ```
53
+
54
+ The tool does not treat every AWS failure as IAM. Expired credentials, missing configuration, network errors, and missing resources get distinct results.
55
+
56
+ ## Install and use
57
+
58
+ The normal installation does not require Rust or Cargo. Install the native executable in an isolated environment with `pipx`:
59
+
60
+ ```console
61
+ pipx install aws-why
62
+ aws-why run -- aws sts get-caller-identity
63
+ aws-why run --json -- aws s3api get-object --bucket example --key report.csv report.csv
64
+ ```
65
+
66
+ Or use `uv`:
67
+
68
+ ```console
69
+ uv tool install aws-why
70
+ ```
71
+
72
+ Release wheels contain the compiled executable; Python is only the distribution mechanism. Wheels are built for macOS on Apple Silicon and Intel, Linux on ARM64 and x86-64, and Windows x86-64.
73
+
74
+ The command after `--` is executed with exactly the supplied argument vector and inherited environment. `stdin` is inherited and human-mode `stdout` is streamed. `stderr` is held in a secure temporary file until the result is classified. On success, `aws-why` adds no output. It returns the wrapped command's exit code.
75
+
76
+ In `--json` mode, successful command output is replayed from secure temporary files. For failures, command output is replaced with one JSON diagnostic object on stdout so CI consumers can parse it reliably. Replay is capped at 64 MiB for stdout and 8 MiB for stderr; analysis retains only the final 1 MiB of stderr.
77
+
78
+ Each follow-up AWS call has a five-second timeout by default. Change it with `--diagnostic-timeout <seconds>`.
79
+
80
+ ## Evidence hierarchy
81
+
82
+ `aws-why` stops at the first useful source:
83
+
84
+ 1. AWS `GetRequestAuthorizationDetails`, when the error contains an authorization ID and the API is supported and permitted.
85
+ 2. An encoded authorization message decoded through STS.
86
+ 3. The AWS service's denial message.
87
+ 4. IAM principal-policy simulation when identity, action, and resource are known.
88
+ 5. `UNKNOWN`.
89
+
90
+ Every action/resource result has its own evidence source and confidence:
91
+
92
+ - `verified`: AWS returned the authorization evaluation for the live request.
93
+ - `reported`: the live AWS error explicitly named the cause.
94
+ - `simulated`: IAM simulation produced the result but did not reproduce the request.
95
+ - `incomplete`: there was not enough evidence for an exact cause.
96
+
97
+ Simulation is never presented as proof that the live request will succeed. It can omit live request conditions, resource policies, endpoint policies, role chaining, and other enforcement layers.
98
+
99
+ ## AWS context and diagnostic permissions
100
+
101
+ Diagnostic calls use the same credential environment plus the wrapped command's explicit `--profile` and `--region`, but they ignore configured custom endpoints and always use the normal AWS endpoint resolver. Follow-up calls are skipped entirely when the original command uses `--no-sign-request` or an explicit `--endpoint-url`.
102
+
103
+ Generated diagnostics redact encoded authorization payloads, common AWS access-key/token formats, and terminal control characters. The wrapped command still runs with its inherited environment and can print any data it chooses—for example, `aws sts get-session-token` prints credentials by design. Do not use `aws-why` to run an untrusted executable, and protect captured CI output as you would ordinary AWS CLI output.
104
+
105
+ AWS may require these permissions for stronger explanations:
106
+
107
+ - `sts:GetCallerIdentity`
108
+ - `iam:GetRequestAuthorizationDetails`
109
+ - `sts:DecodeAuthorizationMessage`
110
+ - `iam:SimulatePrincipalPolicy`
111
+
112
+ The original command still runs if none of those diagnostic permissions are available; the result simply becomes less specific.
113
+
114
+ ## Current scope
115
+
116
+ The action/resource parser is intentionally optimized for S3, Secrets Manager, KMS, IAM, and STS. AWS authorization IDs are not currently returned by every service or API. Cross-organization details can also be withheld by AWS. In those cases, `aws-why` reports the known identity/action/resource and says that the exact denial reason is unknown.
117
+
118
+ `aws-why` recognizes only a direct `aws` executable. Shell pipelines and commands such as `sh -c 'aws ...'` still execute, but follow-up AWS diagnostics are not attempted because their effective AWS context cannot be recovered safely.
119
+
120
+ ## Development
121
+
122
+ ```console
123
+ cargo fmt --check
124
+ cargo test
125
+ cargo clippy --all-targets --all-features -- -D warnings
126
+ maturin build --release --bindings bin
127
+ ```
128
+
129
+ The end-to-end tests use a temporary fake AWS executable and never contact AWS.
130
+
131
+ Tagged releases build platform-specific wheels and publish them through PyPI Trusted Publishing. Before the first public release, configure this repository as a trusted publisher for the `aws-why` PyPI project with environment name `pypi`, require maintainer approval on that GitHub environment, protect release tags, and push a tag matching the Cargo version, such as `v0.1.0`. The workflow rejects tags that do not match the Cargo package version, and every third-party action is pinned to an immutable commit.
132
+
@@ -0,0 +1,5 @@
1
+ aws_why-0.1.0.data\scripts\aws-why.exe,sha256=l0SpTyptpRp98iZOfN93-Urrw1XCOhomfNWzl6dPJUM,2351104
2
+ aws_why-0.1.0.dist-info\METADATA,sha256=SlDDKQTNBLUkOJZuqP6F9vKCuQJd9Zu-dJ541C7aFGc,6616
3
+ aws_why-0.1.0.dist-info\WHEEL,sha256=jsSEiVNsW1dJj5gDaReR40i7mhgBjWtms6nAD6EViXU,94
4
+ aws_why-0.1.0.dist-info\licenses\LICENSE,sha256=XKKSDU9WlUEAyPNlRhq6e2xhVNpJc097JwPZJ1rUnRE,1077
5
+ aws_why-0.1.0.dist-info\RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.11.5)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.