Last reviewed 7 November 2026

Security

For whoever reviews CostCapper before it goes into your AWS account: exactly what it can do there, what it stores, what leaves your account and how updates are trusted. Everything below comes from the CloudFormation template you launch.

Download the one-page summary (PDF)

At a glance

The IAM role, statement by statement

This is every permission the appliance's role has: no AWS managed policies, nothing hidden. The page is generated from the template, so it changes when the template does.

StatementWhat it allowsLimited toActions
ReadSee instances, their status and disks, databases and their tags, CPU metrics and AWS prices. Read-only.Everything it readsec2:DescribeInstances
ec2:DescribeInstanceStatus
ec2:DescribeRegions
ec2:DescribeVolumes
rds:DescribeDBInstances
rds:DescribeDBClusters
rds:ListTagsForResource
cloudwatch:GetMetricData
pricing:GetProducts
StartStopEC2Start and stop EC2 instances.Instances in this account; with Scope = tagged, only those tagged scheduler-managed=trueec2:StartInstances
ec2:StopInstances
NeverStopItself (deny)An explicit deny: it can never start or stop itself, whatever else allows.Anything tagged costcapper:appliance=true, which is the applianceec2:StartInstances
ec2:StopInstances
StartStopRDSInstancesStart and stop RDS databases.DB instances in this account; with Scope = tagged, only tagged onesrds:StartDBInstance
rds:StopDBInstance
StartStopAuroraClustersStart and stop Aurora clusters.Aurora clusters in this account; with Scope = tagged, only tagged onesrds:StartDBCluster
rds:StopDBCluster
MarkManagedEC2Add or remove its one tag on instances it manages, so the failsafe knows what to stop.Only the tag key costcapper:managed; a call naming no keys is refusedec2:CreateTags
ec2:DeleteTags
MarkManagedRDSThe same tag on databases and clusters it manages.Only the tag key costcapper:managed; a call naming no keys is refusedrds:AddTagsToResource
rds:RemoveTagsFromResource
AttachOwnDataVolumeAttach its own data disk when it starts.Only the volume and instance this stack createdec2:AttachVolume
OwnSettingsRead its own settings from Parameter Store.Parameters under /costcapperssm:GetParametersByPath
HeartbeatRecord that it's alive, for the failsafe.One parameter, /costcapper/heartbeatssm:PutParameter
DecryptOwnSecretsDecrypt its own encrypted settings, such as the email password.Only through Parameter Store, where it can read only /costcapperkms:Decrypt
MarketplaceMeteringReport the hourly count of managed machines to AWS Marketplace for billing.Its own product listingaws-marketplace:MeterUsage
SessionManagerLet you open a Session Manager session on the appliance, with your own IAM identity, instead of SSH.The appliance's own SSM Agent; no Run Commandssm:UpdateInstanceInformation
ssmmessages:CreateControlChannel
ssmmessages:CreateDataChannel
ssmmessages:OpenControlChannel
ssmmessages:OpenDataChannel
send-email (optional)Send notification email through Amazon SES in your account.Only if you set AllowSesEmailses:SendEmail
encrypted-volumes (optional)Let EC2 use your keys to start instances whose disks they encrypt.Only the KMS keys you list, and only grants for AWS serviceskms:CreateGrant

Scope is a launch choice: all (the default) lets it manage any machine except itself, and you pick which ones in setup; tagged makes AWS itself refuse anything not tagged scheduler-managed=true.

Show the role exactly as it is in the template
  Role:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - { Effect: Allow, Principal: { Service: ec2.amazonaws.com }, Action: sts:AssumeRole }
      # No AWS managed policies: AmazonSSMManagedInstanceCore would allow ssm:GetParameter(s) on
      # every parameter in the account, which with DecryptOwnSecrets means every SecureString.
      Policies:
        - PolicyName: costcapper
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Sid: Read
                Effect: Allow
                Action:
                  - ec2:DescribeInstances
                  - ec2:DescribeInstanceStatus
                  - ec2:DescribeRegions
                  - ec2:DescribeVolumes
                  - rds:DescribeDBInstances
                  - rds:DescribeDBClusters
                  - rds:ListTagsForResource
                  - cloudwatch:GetMetricData
                  - pricing:GetProducts
                Resource: "*"
              - Sid: StartStopEC2
                Effect: Allow
                Action: [ec2:StartInstances, ec2:StopInstances]
                Resource: !Sub arn:${AWS::Partition}:ec2:*:${AWS::AccountId}:instance/*
                Condition: !If
                  - TaggedScope
                  - { StringEquals: { "aws:ResourceTag/scheduler-managed": "true" } }
                  - !Ref AWS::NoValue
              - Sid: NeverStopItself
                Effect: Deny
                Action: [ec2:StartInstances, ec2:StopInstances]
                Resource: "*"
                Condition: { StringEquals: { "aws:ResourceTag/costcapper:appliance": "true" } }
              - Sid: StartStopRDSInstances
                Effect: Allow
                Action: [rds:StartDBInstance, rds:StopDBInstance]
                Resource: !Sub arn:${AWS::Partition}:rds:*:${AWS::AccountId}:db:*
                Condition: !If
                  - TaggedScope
                  - { StringEquals: { "rds:db-tag/scheduler-managed": "true" } }
                  - !Ref AWS::NoValue
              - Sid: StartStopAuroraClusters
                Effect: Allow
                Action: [rds:StartDBCluster, rds:StopDBCluster]
                Resource: !Sub arn:${AWS::Partition}:rds:*:${AWS::AccountId}:cluster:*
                Condition: !If
                  - TaggedScope
                  - { StringEquals: { "rds:cluster-tag/scheduler-managed": "true" } }
                  - !Ref AWS::NoValue
              # Discovery tags each managed machine costcapper:managed=true, which the failsafe
              # stops, and removes the tag when it stops managing one. Only that one tag key:
              # the Null check stops a DeleteTags call that names no keys (which deletes them all).
              - Sid: MarkManagedEC2
                Effect: Allow
                Action: [ec2:CreateTags, ec2:DeleteTags]
                Resource: !Sub arn:${AWS::Partition}:ec2:*:${AWS::AccountId}:instance/*
                Condition:
                  ForAllValues:StringEquals: { "aws:TagKeys": ["costcapper:managed"] }
                  "Null": { "aws:TagKeys": "false" }
              - Sid: MarkManagedRDS
                Effect: Allow
                Action: [rds:AddTagsToResource, rds:RemoveTagsFromResource]
                Resource:
                  - !Sub arn:${AWS::Partition}:rds:*:${AWS::AccountId}:db:*
                  - !Sub arn:${AWS::Partition}:rds:*:${AWS::AccountId}:cluster:*
                Condition:
                  ForAllValues:StringEquals: { "aws:TagKeys": ["costcapper:managed"] }
                  "Null": { "aws:TagKeys": "false" }
              # costcapper-prepare attaches the data volume itself (see DataVolumeParameter).
              # CloudFormation tags both with the stack's ID, so only this stack's pair qualifies.
              - Sid: AttachOwnDataVolume
                Effect: Allow
                Action: ec2:AttachVolume
                Resource:
                  - !Sub arn:${AWS::Partition}:ec2:${AWS::Region}:${AWS::AccountId}:volume/*
                  - !Sub arn:${AWS::Partition}:ec2:${AWS::Region}:${AWS::AccountId}:instance/*
                Condition:
                  StringEquals: { "aws:ResourceTag/aws:cloudformation:stack-id": !Ref AWS::StackId }
              - Sid: OwnSettings
                Effect: Allow
                Action: ssm:GetParametersByPath
                Resource: !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/costcapper
              - Sid: Heartbeat
                Effect: Allow
                Action: ssm:PutParameter
                Resource: !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/costcapper/heartbeat
              - Sid: DecryptOwnSecrets
                Effect: Allow
                Action: kms:Decrypt
                Resource: "*"
                Condition: { StringEquals: { "kms:ViaService": !Sub "ssm.${AWS::Region}.amazonaws.com" } }
              - Sid: MarketplaceMetering
                Effect: Allow
                Action: aws-marketplace:MeterUsage
                Resource: "*"
              # Session Manager's minimum, so admins reach the appliance without SSH. No ec2messages,
              # so Run Command can't be used on it, and no ssm:GetParameter(s).
              - Sid: SessionManager
                Effect: Allow
                Action:
                  - ssm:UpdateInstanceInformation
                  - ssmmessages:CreateControlChannel
                  - ssmmessages:CreateDataChannel
                  - ssmmessages:OpenControlChannel
                  - ssmmessages:OpenDataChannel
                Resource: "*"
        - !If
          - SesEmail
          - PolicyName: send-email
            PolicyDocument:
              Version: "2012-10-17"
              Statement:
                - { Effect: Allow, Action: ses:SendEmail, Resource: "*" }
          - !Ref AWS::NoValue
        - !If
          - HasKmsKeys
          - PolicyName: encrypted-volumes
            PolicyDocument:
              Version: "2012-10-17"
              Statement:
                - Effect: Allow
                  Action: kms:CreateGrant
                  Resource: !Ref KmsKeyArns
                  Condition: { Bool: { "kms:GrantIsForAWSResource": "true" } }
          - !Ref AWS::NoValue
      Tags: [{ Key: Project, Value: CostCapper }]

The failsafe's own role

A small Lambda function (optional, on by default) has a separate role: ec2:DescribeInstances, ec2:DescribeRegions, ec2:StopInstances, logs:CreateLogStream, logs:PutLogEvents, rds:DescribeDBClusters, rds:DescribeDBInstances, rds:StopDBCluster, rds:StopDBInstance, sns:Publish, ssm:GetParameter. It can stop, never start, and only machines tagged costcapper:managed=true.

Show the failsafe role exactly as it is in the template
  FailsafeRole:
    Type: AWS::IAM::Role
    Condition: Failsafe
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - { Effect: Allow, Principal: { Service: lambda.amazonaws.com }, Action: sts:AssumeRole }
      Policies:
        - PolicyName: failsafe
          PolicyDocument:
            Version: "2012-10-17"
            Statement:
              - Effect: Allow
                Action: [logs:CreateLogStream, logs:PutLogEvents]
                Resource: !GetAtt FailsafeLogs.Arn
              - Effect: Allow
                Action: [ec2:DescribeRegions, ec2:DescribeInstances, rds:DescribeDBInstances, rds:DescribeDBClusters]
                Resource: "*"
              - Effect: Allow
                Action: ec2:StopInstances
                Resource: !Sub arn:${AWS::Partition}:ec2:*:${AWS::AccountId}:instance/*
                Condition: { StringEquals: { "aws:ResourceTag/costcapper:managed": "true" } }
              - Effect: Allow
                Action: rds:StopDBInstance
                Resource: !Sub arn:${AWS::Partition}:rds:*:${AWS::AccountId}:db:*
                Condition: { StringEquals: { "rds:db-tag/costcapper:managed": "true" } }
              - Effect: Allow
                Action: rds:StopDBCluster
                Resource: !Sub arn:${AWS::Partition}:rds:*:${AWS::AccountId}:cluster:*
                Condition: { StringEquals: { "rds:cluster-tag/costcapper:managed": "true" } }
              - Effect: Allow
                Action: ssm:GetParameter
                Resource: !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/costcapper/heartbeat
              - Effect: Allow
                Action: sns:Publish
                Resource: !Ref FailsafeTopic

Network

What it stores and what leaves your account

How updates are trusted

CostCapper updates itself from signed releases published at costcapper.com. The appliance trusts a release only if all of these hold:

The web app can download an update but can't install it. A separate root service checks everything again, installs it next to the running version, backs up the database, switches over and waits for a health check, and puts the previous version back if that fails. The operating system's security updates install themselves nightly.

If CostCapper itself stops

The appliance writes a heartbeat to Parameter Store. Each night, the failsafe function checks it; if CostCapper hasn't checked in for 30 minutes, it stops the machines CostCapper manages and, if you gave an email address, tells you. Machines tagged scheduler-failsafe=exempt are left alone.

Removing it

Delete the CloudFormation stack. Your machines are left as they are. Stop managing them first and the costcapper:managed tags come off too. The data volume is kept as a snapshot.

Reporting a security problem

Email hello@costcapper.com with "Security" in the subject. Please give us a chance to fix the problem before you share details publicly. Our security.txt has the same contact.