Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does one list all the services? #475

Open
nitrocode opened this issue May 3, 2024 · 0 comments
Open

How does one list all the services? #475

nitrocode opened this issue May 3, 2024 · 0 comments

Comments

@nitrocode
Copy link

nitrocode commented May 3, 2024

Problem

I was having issues finding the service name for amazon health events (health) and privateca (acm-pca) and it would be nice to do query a service-table that could match on the service name, description, etc

Proposal

✗ policy_sentry query service-table | grep -i health
health | AWS Health APIs and Notifications

Workaround

My workaround which works if I can guess a portion of the name like health.

✗ policy_sentry initialize --fetch
✗ jq 'keys' ~/.policy_sentry/iam-definition.json | grep health
  "health",
  "healthlake",

This is harder with privateca where my guesses would be difficult unless I searched for ca unless there was some kind of description associated with each service.

✗ jq 'keys' ~/.policy_sentry/iam-definition.json | grep ca
  "acm-pca",
  "application-autoscaling",
  "application-cost-profiler",
  "application-transformation",
  "applicationinsights",
  "autoscaling",
  "autoscaling-plans",
  "cases",
  "cassandra",
  "codecatalyst",
  "codestar-notifications",
  "comprehendmedical",
  "connect-campaigns",
  "controlcatalog",
  "customer-verification",
  "elasticache",
  "elemental-support-cases",
  "forecast",
  "inspector-scan",
  "mechanicalturk",
  "medical-imaging",
  "notifications",
  "notifications-contacts",
  "pca-connector-ad",
  "servicecatalog",

Some extra parsing and we can do it using the .service_name

✗ jq 'del(.policy_sentry_schema_version) | to_entries | .[].value | {name: .service_name, prefix: .prefix}' ~/.policy_sentry/iam-definition.json | grep -i private -B1 -A1
{
  "name": "AWS Certificate Manager Private Certificate Authority",
  "prefix": "acm-pca"
--
{
  "name": "AWS Private CA Connector for Active Directory",
  "prefix": "pca-connector-ad"
--
{
  "name": "AWS re:Post Private",
  "prefix": "repostspace"
--
{
  "name": "AWS service providing managed private networks",
  "prefix": "private-networks"
}

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant