Saturday, 27 July 2024

AWS Inspector Service

 AWS Inspector is a security assessment service offered by Amazon Web Services (AWS) designed to help improve the security and compliance of applications deployed on AWS. It automatically assesses applications for vulnerabilities or deviations from best practices. AWS Inspector is used to identify security issues and provide recommendations for remediation.

Key features of AWS Inspector include:

  1. Automated Security Assessments: It automatically discovers the network configuration and identifies running instances, allowing users to initiate security assessments on those instances.

  2. Agent-Based and Agentless Assessments: Users can choose between agent-based assessments, which require installing an agent on instances, or agentless assessments, which do not.

  3. Security Best Practices and Compliance Checks: Inspector includes built-in rules packages that help check compliance with various security best practices and standards, such as CIS Benchmarks, AWS Best Practices, and others.

  4. Vulnerability Management: It identifies known vulnerabilities in the operating system and application dependencies.

  5. Detailed Findings: Provides detailed reports with findings and recommendations, including the severity level of the issues and suggested remediation steps.

  6. Integration with AWS Services: AWS Inspector integrates with other AWS services like AWS CloudTrail, AWS Lambda, and Amazon SNS, enabling automated responses to findings and streamlined security workflows.

Using AWS Inspector helps organizations enhance their security posture by identifying and addressing potential vulnerabilities in their AWS environments.



Amazon Inspector: Overview, Benefits and How to Get Started?

Cloud security refers to the technologies, policies, and services that help to protect cloud-hosted data, applications, and infrastructure from various internet threats. Amazon Inspector is a security service that helps improve the security of deployed applications on AWS.

In this blog, we will discuss Amazon Inspector and cover topics like:

  • What is Amazon Inspector ?
  • What are the benefits of AWS Inspector
  • How Amazon Inspector works ?
  • How to get started with Amazon Inspector ?


What is Amazon Inspector ?

Amazon Inspector is an AWS service to test network accessibility of EC2 instance. It helps you to identify vulnerabilities within your EC2 instances and applications. And allows you to make security testing more regular occurrence as part of the development and IT operations. Amazon Inspector provides a clear list of security and compliance findings assigned a priority by the severity level. AWS Inspector security assessments help you check for unintended network accessibility of EC2 instances and vulnerabilities on those EC2 instances.

What are the benefits of AWS Inspector ?

Amazon inspector is a safe and reliable service we can use for security purpose in our services, deployed applications etc. Here are some benefits of AWS Inspector :

  • Automated Service: AWS Inspector is a beneficial service for the application’s security in the AWS cloud. It can fix automatically without the interaction of human resources.
  • Regular Security Monitoring: Amazon Inspector helps to find security vulnerabilities in applications, as well as departures from security best practices, both before they’ve been deployed or running in production. This improves the overall security of your AWS-hosted applications.
  • Leverage Aws Security Expertise: AWS Inspector includes a knowledge base of numbers of rules charted to common security best practices and vulnerability definitions. It uses AWS’s Security Expertise, where AWS is constantly updating the security best practices and rules, so one gets the best of both worlds.
  • Integrate Security Into DevOps: AWS Inspector is an API-bound service that analyzes network configurations in your AWS account. Moreover, it uses an optional agent for visibility into EC2 Instances. The agent makes it easy to build Inspector assessments right into your existing DevOps process and empowering both development and operations teams to make security assessments an essential part of the deployment process.

How Amazon Inspector works ?

Amazon Inspector performs an automatic assessment and generates a findings report containing steps to keep the environment safe. To use this service, you need to define the collection of AWS all the resources that complete the application to proceed and tested. It is followed by adding and performing the security practices. You can also set the duration of that assessment which can vary from 15 Min to 12 Hours or last for one day.

An Inspector Agent runs on the EC2 machines hosting the application that monitors the network, file system, and process activity. After collecting all the required data, it is compared with the built-in security rules to identify security or compliance issues.

Here is the prototype of Amazon Inspector for simple understanding :

No alt text provided for this image

How to get started with Amazon Inspector ?

AWS Inspector is a security service that helps to monitor and improve the security and compliance of web applications running inside AWS.

Step 1. Launch An EC2 Instance: Firstly, if you don’t have an AWS account, Register for an AWS Free tier account. Secondly, we will launch a Linux EC2 Instance.

  1. Click on Launch Instance.
  2. Select Amazon Linux AMI(HVM), SSD Volume Type.
  3. Select Subnet and Enable Auto-assign public IP
  4. Add a Tag to your EC2 instance.
  5. Configure Security Group and Select EC2-SG(existing security group).

Step 2. Modify Security Group & Open Port 21: After launch the EC2 instance, we have to modify the security group inbound port 21 open.

Step 3. Define An Assessment target: Now, select EC2 instance as the assessment target

  • Go to Services and choose Amazon inspector, click on Get Started.
  • Define an Assessment target and check Install Agent on EC2

Step 3. Define An Assessment Template: After the assessment target, now define the assessment template.

  1. Please give it a name: myassessmenttemplate.
  2. Set Duration to 1Hour( as its demo).
  3. Uncheck Assessment Schedule and hit Next

Now Review and click on Create

Step 4. Findings: Assessment Run will start automatically. Now, go to the findings and Review the risk.

Step 5. Again Review Findings: After successfully deleting open ports, we will run the Assessment and review Finding; this time, there is no High-risk showing.

This is all about the AWS Inspector.

1. What is AWS Inspector?

Answer: Amazon Inspector is an automated security assessment service that helps improve the security and compliance of applications deployed on AWS. It automatically assesses applications for vulnerabilities or deviations from best practices. After performing an assessment, it produces a detailed list of security findings prioritized by level of severity.

2. How does AWS Inspector work?

Answer: AWS Inspector works by deploying an agent on the target EC2 instances. The service performs a security assessment of the applications running on those instances. It evaluates the configurations, network, and host-level security issues. The assessments are based on rules packages provided by AWS, which include checks for common vulnerabilities, exposures, and best practices.

3. What types of assessments can AWS Inspector perform?

Answer: AWS Inspector can perform the following types of assessments:

  • Network Reachability: Identifies potential network paths that attackers could use to reach EC2 instances.
  • Host Assessment: Checks for vulnerabilities and unintended network accessibility by analyzing the operating system and application configurations.

4. What are the components of AWS Inspector?

Answer: The key components of AWS Inspector include:

  • Assessment Targets: Define the set of AWS resources to be assessed.
  • Assessment Templates: Specify the rules packages to use and other configuration settings for the assessment.
  • Findings: The output of an assessment, which includes detailed information about potential security issues.
  • Agents: Installed on EC2 instances to collect data for assessments.

5. How do you set up an assessment in AWS Inspector?

Answer: To set up an assessment in AWS Inspector:

  1. Install the Agent: Deploy the AWS Inspector Agent on your EC2 instances.
  2. Create an Assessment Target: Define the AWS resources to be assessed.
  3. Create an Assessment Template: Configure the rules packages and other settings.
  4. Run the Assessment: Start the assessment based on the template.
  5. Review Findings: Analyze the findings and take necessary actions to mitigate risks.

6. How can you automate assessments with AWS Inspector?

Answer: You can automate assessments with AWS Inspector by:

  • Using AWS CloudFormation to deploy assessment templates and targets.
  • Scheduling assessments using Amazon CloudWatch Events or AWS Lambda.
  • Integrating with CI/CD pipelines to trigger assessments during application deployment processes.

7. How does AWS Inspector integrate with other AWS services?

Answer: AWS Inspector integrates with several other AWS services, including:

  • AWS CloudTrail: Logs API calls made by AWS Inspector.
  • Amazon CloudWatch: Monitors and logs assessment activities.
  • AWS Config: Tracks changes to AWS resources and assesses their compliance.
  • AWS Security Hub: Aggregates and prioritizes findings from multiple AWS security services, including Inspector.

8. What are some best practices for using AWS Inspector?

Answer: Some best practices for using AWS Inspector include:

  • Regularly run assessments to ensure ongoing security compliance.
  • Integrate findings with AWS Security Hub for a consolidated view of security issues.
  • Use automated remediation tools to quickly address identified vulnerabilities.
  • Ensure all EC2 instances have the AWS Inspector Agent installed.
  • Review and update assessment templates and rules packages regularly to stay current with new threats.

If you have any specific scenarios or more detailed questions, feel free to ask!

Sunday, 21 July 2024

Configure the Linux EC2 instance in AWS and installing Apache

 

Scenario:

Your company wants to start shifting from using on-premises servers to using servers in the cloud. Rather than purchasing all the infrastructure in a data center, they ask you to create an EC2 instance in AWS to host their new website.

Requirements

  • AWS free tier account

Step 1: Deploy EC2 Instance

Access the EC2 service through your AWS account. Use the search bar at the top left to locate the service if it is not listed on your homepage.

Click “Launch Instance”

Now we can name it and select the desired AMI and instance type. I’ll choose an instance type that remains in the free tier.

Next, we need to create a Key Pair. This will issue a set of SSH keys to enable us to remote into our instance via SSH.

Next, we need to create a new security group to allow the public to access the webpage and allow us to ssh into the server. Check all boxes and input your IP address in the “Allow SSh traffic from” drop menu. This will allow only access from your IP to be able to SSH to the server.

Click “Launch Instance” to deploy the instance.

Step 2: SSH into the Instance

Now will SSh into the instance. From the EC2 services page locate and click on your instance.

Click on the “Connect” button then the “SSH client tab”. This will display the necessary information and commands we will use to remote in.

Open up a terminal on your local machine and follow the instructions as outlined.

Show successful log in

Step 3: Install Apache

Let’s create a BASH script for the installation. Open up your favorite editor and input the following code.

#!/bin/bash
sudo yum update -y
yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo echo '<center><h1>This Apache Web Server is Running on an AWS EC2 Instance </h1></center>' > /var/www/html/index.html

Save the file as “install.sh” and give it execute permissions and run the script.

Running BASH Script

Final Step: Access web site

Now that the service has been installed and is running. Input the public IP of the instance into a web browser to confirm