Thursday, December 17, 2020

#35 AWS EBS DEMO - Resizing & Changing Type, EBS Snapshot, Attach & Detach

#35 AWS EBS DEMO - Resizing & Changing Type, EBS Snapshot, Attach & Detach

This Session Contents the Details of EBS as of Below.

1. What are the different types of EBS volumes?
2. How to resize and change EBS volume type (modifying EBS volume)? 3. Taking EBS Snapshot. 4.Using Volume in Different AZs 5.Creating AMI 6.Copy AMI Image with Another Region

Wednesday, December 16, 2020

#33 EBS Volume | Creating EBS Volume | Attach EBS Volume | Mount EBS Volume

Format and mount an attached volume



Command Reference: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html

Tuesday, December 15, 2020

#32 AWS EBS Tutorial | Amazon Elastic Block Store

AWS EBS


Amazon Elastic Block Store (EBS) is an easy to use, high-performance, block-storage service designed for use with Amazon Elastic Compute Cloud (EC2) for both throughput and transaction-intensive workloads at any scale. A broad range of workloads, such as relational and non-relational databases, enterprise applications, containerized applications, big data analytics engines, file systems, and media workflows are widely deployed on Amazon EBS.


More Details Document for EBS: https://aws.amazon.com/ebs/?ebs-whats-new.sort-by=item.additionalFields.postDateTime&ebs-whats-new.sort-order=desc 

Monday, December 14, 2020

#24 Amazon EC2 Shutdown Behaviour and Termination Protection Tutorial

EC2 Hibernate


AWS  giving you the ability to launch EC2 instances, set them up as desired, hibernate them, and then bring them back to life when you need them. The hibernation process stores the in-memory state of the instance, along with its private and elastic IP addresses, allowing it to pick up exactly where it left off.



This feature is available today and you can use it on freshly launched M3, M4, M5, C3, C4, C5, R3, R4, and R5 instances running Amazon Linux 1 (support for Amazon Linux 2 is in the works and will be ready soon). It applies to On-Demand instances and instances running with Reserved Instance coverage.


Reference: https://aws.amazon.com/blogs/aws/new-hibernate-your-ec2-instances/

Tuesday, December 8, 2020

AWS Auto Scaling Group

 

AWS Auto Scaling

AWS Auto Scaling Group

AWS Auto Scaling

AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost. Using AWS Auto Scaling, it’s easy to setup application scaling for multiple resources across multiple services in minutes.

How to Configure Auto Scaling Group

In EC2 Console go to Auto Scaling Configuration 

if there are no ASG configured, you will find the above flash page and to create ASG click on the create Autoscaling group button.

Auto Scaling Group having two main components to configure 

  1. launch Configuration
  2. Auto Scaling Properties 


if you have not created a launch template then to create template click on create launch Template 

Launch Template: Launch templates enable you to store launch parameters so that you do not have to specify them every time you launch an instance. For example, a launch template can contain the AMI ID, instance type, and network settings that you typically use to launch instances.

to create a launch template pass the parameters like AMI ID, Instance Type, SSH Key, Security Group, UserData.

here we have added user data for HTTP server installation. (each new instance created with auto-scaling activity will take the default configuration as user-data passed through launch template)

#!/bin/bash
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo “WelCome to AS

Post-launch template creation, you need to select from the drop-down button (you can see the launch template config details).

Auto Scaling Group configuration with VPC and Subnets

with Auto Scaling Group Configuration we can select existing Load Balancer or we can create New (of course you can choose none if you don't want to configure), here you can select LB type ALB to NLB and load balancer other properties like a load balancer scheme, VPC, Subnet.

other load balancer properties like target group, health check, and cool-down period.

Scaling Group size and scaling policy configuration.

Minimum Capacity: This is the minimum number of instances that have to be there in your Autoscaling Group at all times. Your autoscaling group always maintains this number and never terminates instances below this number.

Maximum Capacity: This is the maximum number of instances that your autoscaling group can have. Your autoscaling will never increase the number of instances more than the specified Max number.

Desired Capacity: The desired amount represents the “current amount” of instances in your autoscaling group. An autoscaling group will start by launching as many instances as specified as the desired capacity. When scaling policies are set, the desired capacity is adjusted between the minimum and maximum amount.

Desired capacity should be set greater than or equal to the min value and less than or equal to the max value.

Review All configuration for ASG.

Auto Scaling Group Created.

Auto Scaling Group Configuration review, Edit, or delete can be done from here.

On the Activity tab, under Activity history, the Status column shows whether your Auto Scaling group has successfully launched or terminated instances. here you can see the new instance launched.

Load Balancer created with ASG (review configuration)

Access DNS to access HTTP server configured in ASG launch Template 

Auto Scaling Policy 

Add Scaling Policy from Automatic Scaling Tab.

Scaling policy types

Amazon EC2 Auto Scaling supports the following types of scaling policies:

  • Target tracking scaling — Increase or decrease the current capacity of the group based on a target value for a specific metric. This is similar to the way that your thermostat maintains the temperature of your home — you select a temperature and the thermostat does the rest.
  • Step scaling — Increase or decrease the current capacity of the group based on a set of scaling adjustments, known as step adjustments, that vary based on the size of the alarm breach.
  • Simple scaling — Increase or decrease the current capacity of the group based on a single scaling adjustment.

Creating Target Tracking Policy here with metric type is the CPU utilization of 50%

Policy Review, from this page user, can delete exit policy

Cloud Watch Alarm will be created with Target Tracking Policy.

Updating Desired Capacity to test Target Tracking Policy.

Updated Desired Capacity, this will add new Instance in Activity, you can see the new instance added so now there are 2 instance should be running.

New Instance added and it's running

Cloud Watch Alarm triggered with continuous CPU utilization down with threshold.

CPU Utilization of Instance.

with Policy Trigged instance removed the same you can see in activity 

Validate Instance drained 

This is the complete guild for how to configure Auto Scaling Group with LB & Policy


AWS - Auto Scaling Group, Launch Configuration, Scale-out & Scale-in Pol...

Wednesday, December 2, 2020

Signature Verification using OpenSSL

generate RSA Private Key

 #openssl genrsa -out private.pem 2048


Generate RSA public Key from Private Key

#openssl rsa -in private.pem -outform PEM -pubout -out public.pem


Sing Operation using RSA Private Key

#openssl sha1 -sign private.pem test > sig.bin

Verify Operation using RSA Public Key

#openssl sha1 -verify public.pem -signature sig.bin test


OpenSSL ECDSA sign and verify file

 EC Key generation with Specific Curves

openssl ecparam -genkey -name brainpoolP512r1 -noout -out private.pem


EC Public Key Generation 

openssl ec -in private.pem -pubout -out public.pem


Sign Verify:

openssl dgst -sha1 -sign private.pem test > signature.bin

openssl dgst -sha1 -verify public.pem -signature signature.bin test


Openssl ecparam list_curves , openssl list ec curves

  openssl ecparam -list_curves


[root@hyd1688 ec_sign_verify]# openssl ecparam -list_curves

  secp112r1 : SECG/WTLS curve over a 112 bit prime field

  secp112r2 : SECG curve over a 112 bit prime field

  secp128r1 : SECG curve over a 128 bit prime field

  secp128r2 : SECG curve over a 128 bit prime field

  secp160k1 : SECG curve over a 160 bit prime field

  secp160r1 : SECG curve over a 160 bit prime field

  secp160r2 : SECG/WTLS curve over a 160 bit prime field

  secp192k1 : SECG curve over a 192 bit prime field

  secp224k1 : SECG curve over a 224 bit prime field

  secp224r1 : NIST/SECG curve over a 224 bit prime field

  secp256k1 : SECG curve over a 256 bit prime field

  secp384r1 : NIST/SECG curve over a 384 bit prime field

  secp521r1 : NIST/SECG curve over a 521 bit prime field

  prime192v1: NIST/X9.62/SECG curve over a 192 bit prime field

  prime192v2: X9.62 curve over a 192 bit prime field

  prime192v3: X9.62 curve over a 192 bit prime field

  prime239v1: X9.62 curve over a 239 bit prime field

  prime239v2: X9.62 curve over a 239 bit prime field

  prime239v3: X9.62 curve over a 239 bit prime field

  prime256v1: X9.62/SECG curve over a 256 bit prime field

  sect113r1 : SECG curve over a 113 bit binary field

  sect113r2 : SECG curve over a 113 bit binary field

  sect131r1 : SECG/WTLS curve over a 131 bit binary field

  sect131r2 : SECG curve over a 131 bit binary field

  sect163k1 : NIST/SECG/WTLS curve over a 163 bit binary field

  sect163r1 : SECG curve over a 163 bit binary field

  sect163r2 : NIST/SECG curve over a 163 bit binary field

  sect193r1 : SECG curve over a 193 bit binary field

  sect193r2 : SECG curve over a 193 bit binary field

  sect233k1 : NIST/SECG/WTLS curve over a 233 bit binary field

  sect233r1 : NIST/SECG/WTLS curve over a 233 bit binary field

  sect239k1 : SECG curve over a 239 bit binary field

  sect283k1 : NIST/SECG curve over a 283 bit binary field

  sect283r1 : NIST/SECG curve over a 283 bit binary field

  sect409k1 : NIST/SECG curve over a 409 bit binary field

  sect409r1 : NIST/SECG curve over a 409 bit binary field

  sect571k1 : NIST/SECG curve over a 571 bit binary field

  sect571r1 : NIST/SECG curve over a 571 bit binary field

  c2pnb163v1: X9.62 curve over a 163 bit binary field

  c2pnb163v2: X9.62 curve over a 163 bit binary field

  c2pnb163v3: X9.62 curve over a 163 bit binary field

  c2pnb176v1: X9.62 curve over a 176 bit binary field

  c2tnb191v1: X9.62 curve over a 191 bit binary field

  c2tnb191v2: X9.62 curve over a 191 bit binary field

  c2tnb191v3: X9.62 curve over a 191 bit binary field

  c2pnb208w1: X9.62 curve over a 208 bit binary field

  c2tnb239v1: X9.62 curve over a 239 bit binary field

  c2tnb239v2: X9.62 curve over a 239 bit binary field

  c2tnb239v3: X9.62 curve over a 239 bit binary field

  c2pnb272w1: X9.62 curve over a 272 bit binary field

  c2pnb304w1: X9.62 curve over a 304 bit binary field

  c2tnb359v1: X9.62 curve over a 359 bit binary field

  c2pnb368w1: X9.62 curve over a 368 bit binary field

  c2tnb431r1: X9.62 curve over a 431 bit binary field

  wap-wsg-idm-ecid-wtls1: WTLS curve over a 113 bit binary field

  wap-wsg-idm-ecid-wtls3: NIST/SECG/WTLS curve over a 163 bit binary field

  wap-wsg-idm-ecid-wtls4: SECG curve over a 113 bit binary field

  wap-wsg-idm-ecid-wtls5: X9.62 curve over a 163 bit binary field

  wap-wsg-idm-ecid-wtls6: SECG/WTLS curve over a 112 bit prime field

  wap-wsg-idm-ecid-wtls7: SECG/WTLS curve over a 160 bit prime field

  wap-wsg-idm-ecid-wtls8: WTLS curve over a 112 bit prime field

  wap-wsg-idm-ecid-wtls9: WTLS curve over a 160 bit prime field

  wap-wsg-idm-ecid-wtls10: NIST/SECG/WTLS curve over a 233 bit binary field

  wap-wsg-idm-ecid-wtls11: NIST/SECG/WTLS curve over a 233 bit binary field

  wap-wsg-idm-ecid-wtls12: WTLS curve over a 224 bit prime field

  Oakley-EC2N-3:

        IPSec/IKE/Oakley curve #3 over a 155 bit binary field.

        Not suitable for ECDSA.

        Questionable extension field!

  Oakley-EC2N-4:

        IPSec/IKE/Oakley curve #4 over a 185 bit binary field.

        Not suitable for ECDSA.

        Questionable extension field!

  brainpoolP160r1: RFC 5639 curve over a 160 bit prime field

  brainpoolP160t1: RFC 5639 curve over a 160 bit prime field

  brainpoolP192r1: RFC 5639 curve over a 192 bit prime field

  brainpoolP192t1: RFC 5639 curve over a 192 bit prime field

  brainpoolP224r1: RFC 5639 curve over a 224 bit prime field

  brainpoolP224t1: RFC 5639 curve over a 224 bit prime field

  brainpoolP256r1: RFC 5639 curve over a 256 bit prime field

  brainpoolP256t1: RFC 5639 curve over a 256 bit prime field

  brainpoolP320r1: RFC 5639 curve over a 320 bit prime field

  brainpoolP320t1: RFC 5639 curve over a 320 bit prime field

  brainpoolP384r1: RFC 5639 curve over a 384 bit prime field

  brainpoolP384t1: RFC 5639 curve over a 384 bit prime field

  brainpoolP512r1: RFC 5639 curve over a 512 bit prime field

  brainpoolP512t1: RFC 5639 curve over a 512 bit prime field

  SM2       : SM2 curve over a 256 bit prime field


Tuesday, September 22, 2020

# 17 AWS Essentials: Amazon Machine Images (AMIs) Demo | AWS In Hindi





Amazon Machine Image (AMI) एक उदाहरण लॉन्च करने के लिए आवश्यक जानकारी प्रदान करता है। ... ऐसी अनुमतियाँ लॉन्च करें, जो AWS खातों को नियंत्रित करने के लिए AWS खातों का उपयोग कर सकती हैं। ब्लॉक डिवाइस मैपिंग जो कि लॉन्च होने पर उदाहरण के लिए वॉल्यूम को निर्दिष्ट करती है।







Reference: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html






Monday, September 21, 2020

Docker in HiNDI | Docker क्या है

 What is Docker? Easy Way | In Hindi | Docker क्या है






Docker एक उपकरण है जिसे Container का उपयोग करके एप्लिकेशन बनाना, तैनात करना और चलाना आसान बनाना है। कंटेनरों को एक डेवलपर को उन सभी भागों के साथ एक एप्लिकेशन को पैकेज करने की अनुमति देता है, जैसे कि पुस्तकालय और अन्य निर्भरताएं, और इसे एक पैकेज पर तैनात करता है। ऐसा करने से, कंटेनर के लिए धन्यवाद, डेवलपर यह आश्वासन दे सकता है कि एप्लिकेशन किसी भी अन्य अनुकूलित सेटिंग्स की परवाह किए बिना किसी भी अन्य Linux मशीन पर चलेगा जो कि मशीन हो सकती है जो कोड लिखने और परीक्षण करने के लिए उपयोग की जाने वाली मशीन से भिन्न हो सकती है।

 Docker कंटेनर पर आधारित अनुप्रयोगों के निर्माण के लिए एक सॉफ्टवेयर प्लेटफॉर्म है - छोटे और हल्के निष्पादन वाले वातावरण जो ऑपरेटिंग सिस्टम कर्नेल का साझा उपयोग करते हैं, लेकिन अन्यथा एक दूसरे से अलगाव में चलते हैं। जबकि एक अवधारणा के रूप में कंटेनर कुछ समय के लिए आसपास रहे हैं, 2013 में लॉन्च किए गए एक ओपन-सोर्स प्रोजेक्ट, डॉकर ने प्रौद्योगिकी को लोकप्रिय बनाने में मदद की है और सॉफ्टवेयर विकास में कंटेनराइजेशन और माइक्रोसर्विस की ओर रुझान बढ़ाने में मदद की है जिसे क्लाउड-देशी के रूप में जाना जाता है।



Sunday, September 20, 2020

What is Docker? Easy way

What is Docker? 




Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

 Docker is a software platform for building applications based on containers — small and lightweight execution environments that make shared use of the operating system kernel but otherwise run in isolation from one another. While containers as a concept have been around for some time, Docker, an open-source project launched in 2013, helped popularize the technology and has helped drive the trend towards containerization and microservices in software development that has come to be known as cloud-native development.




Thursday, July 23, 2020

How to set Jenkins user as root


to set root user for Jenkins to follow below steps for CentOs


1. Open up the script 
vim /etc/sysconfig/jenkins
2. Find this $JENKINS_USER and change to “root”:
$JENKINS_USER="root"
3. Then change the ownership of Jenkins home, webroot and logs:
chown -R root:root /var/lib/jenkins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins
4) Restart Jenkins and check the user has been changed:
service jenkins restart

DevOps Project | terraform Jenkins AWS EC2 | Infrastructure as Code

Saturday, July 11, 2020

Create New User in EC2 Ubuntu |Create Sudo User | How to Become Root Use...

Create a New Sudo User in AWS EC2 (Ubuntu AMI)

Create a New Sudo User in AWS EC2

(Ubuntu AMI)

Log in your Ec2 Instance using “ec2-user”
ssh ec2-user@<ip> -i <ssh key>
 Log in to your server as the root user.
ubuntu@ip-172-31-24-53:~$ sudo -i
root@ip-172-31-24-53:~#
 Use the adduser command to add a new user to your system.
adduser <username>
root@ip-172-31-24-53:~# adduser test


Set and confirm the new user’s password at the prompt. Use 
strong password to secure account
root@ip-172-31-24-53:~# passwd test
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Use the usermod command to add the user to the sudo group.
usermod -aG sudo username
root@ip-172-31-24-53:~# usermod -aG sudo test
By default, on Ubuntu, members of the sudo group have sudo privileges.
Test sudo access on new user account
Use the su command to switch to the new user account.
root@ip-172-31-24-53:~# su test
su - username


As the new user, verify that you can use sudo by prepending “sudo” to the command
that you want to run with superuser privileges.
test@ip-172-31-24-53:/root$ sudo ls -la /root

Thursday, July 9, 2020

Installing JFrog Artifactory on CentOS / RHEL 7

Installing JFrog Artifactory on CentOS / RHEL 7


Artifactory is a universal repository manager created by JFrog.
A repository manager is a software application designed to manage binary
components related to an application. Being a universal repository manager,
Artifactory supports all major packaging formats like Apache Maven, Gradle,
Docker and many more.



# Upgrade to Java-8
sudo yum install java-1.8.0
sudo yum remove java-1.7.0-openjdk
#Setting up JAVA_HOME Environment Variable
echo "export /
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64"/
>> /etc/profile

. /etc/profile
env | grep JAVA
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64

# Installing Artifactory
wget https://bintray.com/jfrog/artifactory-rpms/rpm -O /
bintray-jfrog-artifactory-rpms.repo


sudo mv bintray-jfrog-artifactory-rpms.repo /etc/yum.repos.d/
sudo yum install jfrog-artifactory-oss
echo "export ARTIFACTORY_HOME=/opt/jfrog/artifactory" >> /etc/profile
. /etc/profile
env | grep ARTIFACTORY_HOME
ARTIFACTORY_HOME=/opt/jfrog/artifactory

# Setup Service
sudo service artifactory start

Ethical Hacking Techniques: Cracking WPA/WPA2 Wi-Fi Using WPS and Capturing Handshakes

In the realm of cyber security, ethical hacking plays a crucial role in identifying and addressing vulnerabilities. One of the areas where e...