Skip to main content

More Info:

This rule checks if all of the specified applications are installed on the instance. Optionally, specify the minimum acceptable version. You can also specify the platform to apply the rule only to instances running that platform.

Risk Level

High

Address

Configuration

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • Cloudanix Best Practice
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

To remediate the issue of specified applications not being installed on an AWS EC2 instance, you can follow these steps using the AWS Management Console:
  1. Connect to your EC2 instance:
    • Log in to the AWS Management Console.
    • Navigate to the EC2 dashboard.
    • Identify the EC2 instance where the specified applications need to be installed.
    • Connect to the EC2 instance using SSH (for Linux instances) or RDP (for Windows instances).
  2. Install the specified applications:
    • For Linux instances:
      • Use the package manager (e.g., apt for Ubuntu, yum for Amazon Linux) to install the required applications. For example:
    • For Windows instances:
      • Download the installer for the required applications from the official website or a trusted source.
      • Run the installer and follow the installation instructions.
  3. Verify the installation:
    • Once the applications are installed, verify that they are working correctly.
    • Test the functionality of the applications to ensure they are installed and configured properly.
  4. Update the AMI (optional):
    • If you want to ensure that future instances launched from the same AMI have the specified applications installed, you can create a new AMI from the updated instance.
    • Navigate to the EC2 dashboard, select the updated instance, and create a new AMI from it.
  5. Update Auto Scaling Launch Configuration (if applicable):
    • If your EC2 instances are part of an Auto Scaling group, you may need to update the launch configuration to use the new AMI with the specified applications installed.
    • Navigate to the Auto Scaling groups section in the EC2 dashboard and update the launch configuration.
By following these steps, you should be able to remediate the issue of specified applications not being installed on an AWS EC2 instance.

To remediate the misconfiguration of specified applications not being installed on an AWS EC2 instance using the AWS CLI, follow these steps:
  1. Connect to your AWS account using the AWS CLI by running the aws configure command and providing your AWS Access Key ID, Secret Access Key, default region, and default output format.
  2. Identify the EC2 instance that requires the specified applications to be installed. You can list all your EC2 instances using the following command:
  3. Connect to the identified EC2 instance using SSH. Make sure you have the necessary permissions to connect to the instance.
  4. Once connected to the instance, you can install the specified applications using the package manager available on the instance. For example, if you need to install Apache web server on a Linux instance, you can use the following command:
  5. After installing the required applications, start the services if necessary. For example, to start the Apache web server, you can use the following command:
  6. Verify that the specified applications have been successfully installed and are running as expected. You can test the installation by accessing the application through a web browser or using other appropriate methods.
  7. Once you have verified that the applications are installed and functioning correctly, you have successfully remediated the misconfiguration.
By following these steps, you can ensure that the specified applications are installed on the AWS EC2 instance and the misconfiguration is remediated.
To remediate the misconfiguration of specified applications not being installed on an AWS EC2 instance using Python, you can follow these steps:
  1. Create a Python script: Start by creating a Python script that will install the required applications on the EC2 instance. You can use the boto3 library, which is the AWS SDK for Python, to interact with AWS services.
  2. Install Boto3: If you haven’t already installed the boto3 library, you can do so using pip:
  3. Configure AWS credentials: Make sure you have your AWS credentials configured either by setting environment variables or using the AWS CLI aws configure command.
  4. Write Python script: Here is an example Python script that uses boto3 to connect to AWS EC2 and install the specified applications on the instance:
  5. Run the Python script: Save the script to a file, for example, install_applications.py, and run it using Python:
  6. Verify installation: Once the script has executed successfully, SSH into the EC2 instance and verify that the specified applications have been installed.
By following these steps, you can use Python and boto3 to remediate the misconfiguration of specified applications not being installed on an AWS EC2 instance.
For Windows instances, use the same pattern but with the PowerShell document:
Substitute:
  • INSTANCE_ID with the EC2 instance ID that is non-compliant.
  • LINUX_INSTALL_COMMAND_* / WINDOWS_INSTALL_COMMAND_* with the exact, trusted installation commands (including any required version constraints) for the missing application(s).
This uses SSM Run Command in the same way as the verified CLI remediation, executing with administrative privileges; ensure the instance has SSM Agent running and an IAM role with AmazonSSMManagedInstanceCore attached.No resource replacement is forced by changing or adding these aws_ssm_association resources; they can be created/updated in place, but the commands will run on the target instance when the association evaluates.Verification: terraform plan should show one or more new/updated aws_ssm_association resources whose name is AWS-RunShellScript or AWS-RunPowerShellScript and whose parameters.commands list matches the installation commands you intend to run.

Additional Reading: