awscheck

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package awscheck is `dormeto aws check`: which permissions the profile lacks for each `dormeto aws` method, from IAM's simulation of its policies (iam:SimulatePrincipalPolicy). A caller of the manager's API is an administrator in the manager, so IAM is its only limit: apigateway:GET to find the API, execute-api:Invoke on the routes a method calls (fleet.Routes), and the install's and the estimate's own actions. It reads; it never writes.

Index

Constants

View Source
const Invoke = "execute-api:Invoke"

Invoke is the permission of a route.

Variables

This section is empty.

Functions

func EstimateActions

func EstimateActions() []string

EstimateActions are the estimate's read actions: the adapters' operations (internal/aws.ReadOnlyOperations) as IAM names them.

func PrintJSON

func PrintJSON(w io.Writer, r Report) error

PrintJSON prints the report as one JSON object.

func PrintText

func PrintText(w io.Writer, r Report) error

PrintText prints the report as `gcp check` does: the account and the manager, then a line per method, then the warnings.

Types

type CommandReport

type CommandReport struct {
	Command string   `json:"command"`
	Checked bool     `json:"checked"`
	Held    []string `json:"held"`
	Missing []string `json:"missing"`
}

CommandReport is the verdict for one method: what it needs, held or missing; Checked false when IAM's simulation could not tell (a warning says why).

func (CommandReport) OK

func (c CommandReport) OK() bool

OK tells a method not known to lack a permission.

type IAM

type IAM interface {
	install.Simulator
	ListAccountAliases(ctx context.Context, in *iam.ListAccountAliasesInput, optFns ...func(*iam.Options)) (*iam.ListAccountAliasesOutput, error)
}

IAM is the iam client's calls the check makes: the simulation, and the account's alias.

type Manager

type Manager struct {
	API, APIID, Region, Version string
	VersionErr                  error
	ByName                      bool
}

Manager is the manager the command found: its API (its name when found by name, else the URL given), the API's id ("" when the URL is not an execute-api one) and region, its version ("" when it could not be read, VersionErr says why), and whether it was found by name, which needs apigateway:GET.

type ManagerReport

type ManagerReport struct {
	API     string `json:"api"`
	Version string `json:"version"`
}

ManagerReport is the manager as the report names it.

type Report

type Report struct {
	Account  string          `json:"account"`
	Caller   string          `json:"caller"`
	Manager  *ManagerReport  `json:"manager"`
	Commands []CommandReport `json:"commands"`
	Warnings []string        `json:"warnings"`
	// contains filtered or unexported fields
}

Report is the result of Check.

func Check

func Check(ctx context.Context, i IAM, s STS, r Request) (Report, error)

Check tells, per method, the permissions the caller lacks. A simulation IAM refuses is a report (every method not checked, a warning why), not an error; the caller's identity that cannot be read is one.

func (Report) OK

func (r Report) OK() bool

OK tells that no method lacks a permission.

type Request

type Request struct {
	Env, Region   string
	Manager       *Manager
	LookupRefused bool
}

Request is what the check is about: the environment and region searched, and the manager found (nil: none, NoManager says why: no API of that name, or LookupRefused, the lookup refused).

type STS

type STS interface {
	GetCallerIdentity(ctx context.Context, in *sts.GetCallerIdentityInput, optFns ...func(*sts.Options)) (*sts.GetCallerIdentityOutput, error)
}

STS is the caller's identity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL