Skip to main content

AWS

The AWS bundle installs a catalog scraper that:

  • Scrapes AWS Resources and detects changes in the resource definition
  • Ingests changes from CloudTrail
  • Ingests cost data from AWS Cost & Usage Reporting
  • Links AWS EKS resources to the corresponding Kubernetes resources
Prerequisites
  • IAM Role for scraping AWS API's
  • Mission Control configured to use Pod Identity/IRSA or an AWS access key

Setup

helm repo add flanksource https://flanksource.github.io/charts
helm repo update
helm install mission-control-aws flanksource/mission-control-aws

When you go to the catalog now, you can now see all the AWS Resources

Create an IAM Role

Depending on how you want to use Mission Control you need to create an IAM role for mission control to use:

Use CaseRole
Read Only Scrapingarn:aws:iam::aws:policy/ReadOnlyAccess
Playbooks to create and update AWS Resourcesarn:aws:iam::aws:policy/PowerUserAccess
Create new IAM Policy (Alternative)

You can also create a new policy with just the permissions required by Mission Control

iam-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "mission-control-config-role",
"Effect": "Allow",
"Action": [
"acm:Describe*",
"acm:Get*",
"acm:List*",
"cloudtrail:LookupEvents",
"config:BatchGetAggregateResourceConfig",
"config:BatchGetResourceConfig",
"config:Describe*",
"config:Get*",
"config:List*",
"config:SelectAggregateResourceConfig",
"config:SelectResourceConfig",
"ec2:Describe*",
"ecr:Describe*",
"eks:Describe*",
"eks:ListClusters",
"elasticfilesystem:Describe*",
"elasticloadbalancing:Describe*",
"guardduty:Describe*",
"guardduty:Get*",
"guardduty:List*",
"iam:GetAccountName",
"iam:GetAccountSummary",
"iam:GetGroup",
"iam:GetGroupPolicy",
"iam:GetInstanceProfile",
"iam:GetLoginProfile",
"iam:GetPolicy",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:GetUser",
"iam:List*",
"lambda:List*",
"rds:Describe*",
"sts:GetCallerIdentity"
"trustedadvisor:Describe*",
"trustedadvisor:DownloadRisk",
"trustedadvisor:Get*",
"trustedadvisor:List*",
],
"Resource": "*"
}
]
}

Configure IAM Roles for Mission Control

  1. Ensure the AWS Pod Identity Agent is configured and running

  2. Create a mapping file for eksctl

    eksctl.yaml
    podIdentityAssociations:
    - namespace: mission-control
    serviceAccountName: mission-control-sa
    permissionPolicyARNs: arn:aws:iam::aws:policy/ReadOnlyAccess

    - namespace: mission-control
    serviceAccountName: config-db-sa
    permissionPolicyARNs: arn:aws:iam::aws:policy/ReadOnlyAccess

    - namespace: mission-control
    serviceAccountName: canary-checker-sa
    permissionPolicyARNs: arn:aws:iam::aws:policy/ReadOnlyAccess
    iam:
    # note withOIDC is not required for Pod Identity
    serviceAccounts:
    # used by mission control for notifications / playbooks
    - metadata:
    name: mission-control-sa
    namespace: mission-control
    attachPolicyARNs:
    - "arn:aws:iam::aws:policy/ReadOnlyAccess"
    # used for cloudwatch, S3 and other AWS health checks
    - metadata:
    name: canary-checker-sa
    namespace: mission-control
    attachPolicyARNs:
    - "arn:aws:iam::aws:policy/ReadOnlyAccess"
    # used to scrape resources, AWS CloudTrail and AWS Cost & Usage Reports
    - metadata:
    name: config-db-sa
    namespace: mission-control
    attachPolicyARNs:
    - "arn:aws:iam::aws:policy/ReadOnlyAccess"

    Using an existing IAM Role

    If you are using a pre-existing IAM role when creating a pod identity association, you must configure the role to trust the newly introduced EKS service principal (pods.eks.amazonaws.com)

    iam-trust-policy.json
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Principal": {
    "Service": "pods.eks.amazonaws.com"
    },
    "Action": ["sts:AssumeRole", "sts:TagSession"]
    }
    ]
    }
  3. Apply the Pod Identities using eksctl

    eksctl create podidentityassociation  -c eksctl.yaml

  4. Choose a routable DOMAIN for Mission Control

    See Ingress for more options on configuring the ingress including generating certs with cert-manager

    See Local Testing for testing using a kind or minikube without a routable domain

  5. Install Mission Control

    apiVersion: v1
    kind: Namespace
    metadata:
    name: mission-control
    ---
    apiVersion: source.toolkit.fluxcd.io/v1beta1
    kind: HelmRepository
    metadata:
    name: flanksource
    namespace: mission-control
    spec:
    interval: 5m0s
    url: https://flanksource.github.io/charts
    ---
    apiVersion: helm.toolkit.fluxcd.io/v2beta1
    kind: HelmRelease
    metadata:
    name: mission-control
    namespace: mission-control
    spec:
    chart:
    spec:
    chart: mission-control
    sourceRef:
    kind: HelmRepository
    name: flanksource
    namespace: mission-control
    interval: 1m
    values:

    See values.yaml

values.yaml

The following table lists the configurable parameters and their default values:

ParameterDescriptionDefault
labelsAdditional labels to apply to resources.
scraper.nameName of the AWS scraper."aws"
ParameterDescriptionSchemaDefault
connectionAWS connection details.Connection""
accessKeyName of the access key.EnvVar""
secretKeyName of the secret key.EnvVar""
regionsAWS regions to pull from[]string[]
endpointAWS endpoint.string""
skipTLSVerifySkip TLS verification.boolfalse
assumeRoleAssume AWS role.string""
cloudtrail.maxAgeMaximum age for CloudTrail.""
cloudtrail.excludeList of excluded items for CloudTrail.[]
complianceEnable or disable compliance.true
costReporting.enabledEnable or disable cost reporting.false
costReporting.databaseCost reporting database.""
costReporting.regionCost reporting region.""
costReporting.s3BucketPathS3 bucket path for cost reporting.""
costReporting.tableTable for cost reporting.""
includeResourcesList of resources to include.[]
excludeResourcesList of resources to exclude.[]
6Cost & Usage Reporting
Prerequisites
  • Cost and Usage Reports are configured with an Athena table
  • The AWSQuicksightAthenaAccess policy or similar is attached to config-db IAM role