GlassOps Architecture
This page describes how the released glassops CLI is put together. Everything here is in v1.1.0. For the commands and flags, see the CLI reference.
1. The idea
GlassOps is one command line tool that runs inside your CI. The CI holds the secrets and starts the run. GlassOps works out what changed, checks it, decides whether it may be deployed, deploys it, and then checks that the target holds what was planned.
The decision is a file. glassops gate writes a signed PERMIT, and glassops deploy refuses to touch a target without a valid one for exactly this change.
graph LR
Plan[plan] --> Validate[validate]
Validate --> Gate[gate]
Gate -->|allow| Deploy[deploy]
Gate -->|deny| Stop[run stops]
Deploy --> Verify[verify]
Verify --> Report[report]
2. Components
| Part | What it does |
|---|---|
| CI system | Holds secrets, starts the run and supplies the commit, the pull request and the approvals. GitHub Actions, Bitbucket Pipelines and GitLab CI are supported. The last two have not run on a real runner yet |
glassops CLI |
One Go binary, also shipped as a container image. Each step is its own command, and glassops run runs a named pipeline of them |
| Provider | The part that talks to the deploy target. Salesforce is built in. Provider exec runs your own commands for any other deploy tool. See the exec provider |
| Config | glassops.yaml names the targets, their tiers, the policy rules and the pipelines. See the configuration reference |
| Result files | Every step writes one JSON result to .glassops/results/. Later steps and report read them |
| PERMIT | The signed decision in .glassops/permit.json. See PERMIT and rules |
3. The deploy pipeline
The default deploy pipeline runs six steps against one target.
planworks out the change set between two git refs. With no--from, it starts from the git tagglassops/deployed/<target>, which marks the last commit deployed to that target. With no tag yet, the whole source is planned.validateruns a check-only validation of the change set against the target. It never deploys. It records which plan it validated.gateevaluates the policy rules over the plan, the CI context and the earlier results, then writes a signed PERMIT. A deny is written and signed too, and the run stops.deployverifies the PERMIT first, then checks that the working tree is the PERMIT's commit with no modified tracked files, then logs in and deploys. When the PERMIT holds a passed validation of this plan, it quick deploys that validation. It then moves the deployed tag.verifyreads the target back and checks that it holds what the plan says.reportsummarises every result as markdown and SARIF. It also runs after a failed step.
The default pr pipeline runs the checks without a deploy. See Run a pipeline.
4. The PERMIT
A PERMIT records one decision: whether one plan may be deployed to one target. It binds to the target, the commit, the plan, the change set and the config. Change any of them after gate ran and the PERMIT no longer matches.
- Rules.
gateruns seven built-in rules:plan_not_empty,window.<tier>,blackout,coverage_min,destructive_needs_label,separation_of_dutiesandanalyzer_max_severity. Every rule runs, so a deny lists every reason. - Fail closed. Missing evidence is never a pass. A tool problem while gathering evidence denies.
- Signing. By default the PERMIT is signed with HMAC-SHA256 using
GLASSOPS_PERMIT_KEY. On GitHub Actions it can be signed keyless with Sigstore instead. See Sigstore signing. - Your own rules. Optional Rego rules run after the built-in rules. They can add denials and can never turn a deny into an allow.
5. Security model
Secrets stay in CI
The deploy target never holds deployment secrets. CI holds them and passes them to GlassOps as environment variables. glassops.yaml only names the variables, so no secret value goes in the file.
The signing key stays out of pull request jobs
Anyone who can run a job with GLASSOPS_PERMIT_KEY can sign an allow. Keep the key in a protected CI environment that only the deploy job uses. glassops doctor warns when the key is set on a pull request run. Sigstore signing removes the shared key.
The org Id guard
Before any step does anything to a target, the guard compares the org the login reached with the target in the config. A mismatch stops the command. Tier prod needs a production org and tier ephemeral needs a scratch org.
Isolated logins
Every command that talks to a Salesforce org runs the Salesforce CLI with its own temporary home directory. It never reads or writes the logins on the machine, and the directory is removed when the command ends.
What is never logged
Results, annotations and error messages never contain tokens, private keys, auth URLs, the org's company name or full usernames.
6. Results and evidence
- Every command exits 0 on pass, 1 on a failed check and 2 on a tool error.
- Every step writes
.glassops/results/<step>.jsonin one envelope, described byschemas/result.json. gatewrites the facts it evaluated to.glassops/facts.json.reportwrites a markdown summary and SARIF.- Opt-in extras are a pull request comment and OpenTelemetry export. See PR comment and OpenTelemetry.
7. Failure modes
| Failure | Behaviour | Recovery |
|---|---|---|
| Policy denies | gate exits 1 with a signed deny. deploy never starts |
Fix the change, or meet the rule, and run again |
| Evidence cannot be gathered | gate denies and exits 2 |
Fix the tool or network problem and run again |
| PERMIT does not match | deploy exits 2 before any login |
Run gate again for the current commit and plan |
| Login reaches the wrong org | The guard exits 2 | Fix the target Id or the credentials |
| CI is down | No deploy runs | Deploy by hand with your deploy tool, outside GlassOps |
8. Repository layout
cmd/glassops: the CLI entry point.internal/cli: one file per command.internal/core: config, policy, PERMIT, guard, pipeline, report and telemetry.internal/providers: the Salesforce andexecproviders.internal/ci: the GitHub, Bitbucket, GitLab and local CI layers.schemas: the JSON schemas for the config and the result files.examples: working layouts for each CI system.