Metadata-Version: 2.4
Name: oci-policy-analysis
Version: 7.0.1
Summary: OCI Policy Analysis
Author: Andrew Gregory
License: UPL-1.0
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: Universal Permissive License (UPL)
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: NOTICE.txt
Requires-Dist: oci==2.168.0
Requires-Dist: pydantic<2.13,>=2.11.7
Requires-Dist: deepdiff==8.5.0
Requires-Dist: antlr4-python3-runtime==4.13.2
Requires-Dist: markdown2>=2.5.5
Requires-Dist: tkhtmlview>=0.3.2
Provides-Extra: core
Provides-Extra: ui
Provides-Extra: qt
Requires-Dist: PySide6<7,>=6.8; extra == "qt"
Provides-Extra: qt-build
Requires-Dist: Nuitka==4.2.2; extra == "qt-build"
Requires-Dist: zstandard<1,>=0.25; extra == "qt-build"
Requires-Dist: ordered-set<5,>=4.1; extra == "qt-build"
Provides-Extra: web
Requires-Dist: fastapi>=0.110; extra == "web"
Requires-Dist: uvicorn>=0.29; extra == "web"
Requires-Dist: itsdangerous>=2.2; extra == "web"
Provides-Extra: mcp
Requires-Dist: fastmcp==2.12.5; extra == "mcp"
Provides-Extra: all
Requires-Dist: fastapi>=0.110; extra == "all"
Requires-Dist: uvicorn>=0.29; extra == "all"
Requires-Dist: itsdangerous>=2.2; extra == "all"
Requires-Dist: fastmcp==2.12.5; extra == "all"
Provides-Extra: docs
Requires-Dist: sphinx>=7; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=3; extra == "docs"
Requires-Dist: myst-parser>=2; extra == "docs"
Requires-Dist: sphinxcontrib-mermaid>=2; extra == "docs"
Provides-Extra: commit
Requires-Dist: pipdeptree>=2.30.0; extra == "commit"
Requires-Dist: pre_commit>=4.5.0; extra == "commit"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# OCI Policy Analysis

Analyze OCI IAM policies, compartments, identity domains, groups, users, and dynamic groups from a desktop app, web app, CLI, or MCP server. The tool is read-only: it analyzes data but does not change your tenancy.

The [full documentation](https://agregory999.github.io/oci-policy-analysis) covers setup, OCI access, sample and saved data, web hosting, command-line use, troubleshooting, and embedding.

For 7.0 highlights and a getting-started guide, see [What's new in 7.0](https://agregory999.github.io/oci-policy-analysis/release_7_0.html). The original desktop app remains available; the new desktop app is the recommended experience going forward.

## Quick Start: Download a desktop app

Download either maintained desktop app for macOS or Windows from the [Releases page](https://github.com/agregory999/oci-policy-analysis/releases). The modern app is the recommended experience going forward; the original app remains available and works as before. No Python setup is needed to run a downloaded app.

## Quick Start: Choose your data source

You do **not** have to connect this tool to a live tenancy. Choose from:

- **Sample data:** choose **Sample** in the modern app to explore fictional data without credentials.
- **Live OCI load:** requires an OCI user/API-key profile **and** IAM permissions granted to that principal. Before loading a tenancy, complete [tenancy access](#required-obtain-tenancy-access).
- **Offline CIS Compliance import:** import the directory of OCI CIS Compliance output files without connecting to the tenancy.

## Quick Start: Begin Analysis

Once data has been loaded, it will be available for access later via a local cache.  At this point you can navigate the application and start looking at policy data.

## REQUIRED for Live Tenancy: Obtain tenancy access

Using a downloaded executable from your desktop will enable you direct access to your OCI tenancy.  In order gain access, you will require an API Key for a tenancy.  It is recommended to limit this tool's access to the tenancy to a read-only set of operations.  

Admin API Keys with your DEFAULT profile will work, but it is easy to set up a limited access key specifically for this tool.

### OCI Limited User

1) From your OCI Console, create a new OCI Group in the Default Identity Domain - for example `PolicyAnalysisUsers`.   
2) Next, create a new OCI User in the Default Identity Domain called `policy-analysis-user` - place this user in the group from the previous step
3) Create an (API Key)[https://docs.oracle.com/en-us/iaas/Content/Identity/access/to_upload_an_API_signing_key.htm] for the user that was just created. 
4) Update your local `.oci/config` with a new named profile for this key, for example `POLICY-ANALYSIS`.
5) Create a new IAM Policy in the tenancy root, for example `PolicyAnalysisPolicy`.  The following statement is all that is needed:
```text
allow group <your_group> to {POLICY_READ, COMPARTMENT_INSPECT, DOMAIN_INSPECT, DYNAMIC_GROUP_INSPECT, GROUP_INSPECT, USER_INSPECT, LIMITS_VIEW_INSPECT} in tenancy
```

Once completed, the tool's profile selection dropdown should show `POLICY-ANALYSIS` and can be used to safely run the tool with limited permissions within the tenancy.

## REQUIRED for CIS COMPLIANCE scripts

Assuming you have access to an OCI tenancy already, you can run the supported (CIS Compliance scripts)[https://github.com/oci-landing-zones/oci-cis-landingzone-quickstart] with the `--raw` option.  This will produce a directory - if you were sent a zipped archive, simply unzip it locally.  Then in the Policy Analysis tool, point the CIS Compliance load directory to the unzipped location.   

## More help

The [full documentation](https://agregory999.github.io/oci-policy-analysis) covers mode-specific setup, OCI authentication and permissions, CIS compliance imports, web hosting, CLI and MCP usage, troubleshooting, architecture, and API reference.

