Wednesday, March 30, 2016

How To Setup AWS CodeDeploy using Github

Learn how to setup AWS CodeDeploy using Github for Continuous Deployment & Continuous Integration...


Unlike Microsoft Azure cloud service which offers a very easy and staright forward way to setup the Continuous Deployment and Continuous Delivery with any version control like Github, Bitbucket, or a local repository, I found out AWS CodeDeploy requires a quite complex procedure to achieve the same and hence is limited to only S3 bucket and Github for continuous deployment of code to any EC2 instance. So kindly follow this step-by-step tutorial on to set this up with minimal steps. The AWS doc too seems complex and i searched a lot when finally found some video demonstration for the same which really helped me out.

 AWS CodeDeploy

Introduction To AWS CodeDeploy
AWS CodeDeploy is one of the developer tools by Amazon Web Services which allows for Continuous Integration and Continuous Deployment. AWS CodeDeploy coordinates the application deployments to Amazon EC2 instances, on-premises or both.
AWS CodeDeploy currently deploys application revisions from Github and Amazon S3 buckets.

Pre-requisites for the Tutorial
i.   GitHub Account with Code Repository setup containing the appspec.yml file and scripts folder in the root directory of the application.
Sample Code Structure and appspec.yml file can be found on the following-            
https://github.com/shoobomb/AWS-CodeDeploy-Example
ii.               AWS account setup.





Tutorial
Here goes the tutorial to configure and setup Continuous Deployment with Github Using CodeDeploy –   
  1.    Sign in to your AWS account by going to the following link:

  2.    Next, we create two IAM roles by clicking the services tab and going to the IAM (Identity & Access Management)

i.               First we are going to create IAM role for CodeDeploy to talk to our EC2 instance where our code is deployed. For this we click on create new role by clicking on “Roles” tab, with some name “CodeDeploy”.
ii.               Next, select EC2 and click on Next.
iii.         Then, we are going to add a custom policy to this Role. Add the following policy document to this role and click on create Role.

// Policy Role for Code Deploy
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "autoscaling:PutLifecycleHook",
        "autoscaling:DeleteLifecycleHook",
        "autoscaling:RecordLifecycleActionHeartbeat",
        "autoscaling:CompleteLifecycleAction",
        "autoscaling:DescribeAutoscalingGroups",
        "autoscaling:PutInstanceInStandby",
        "autoscaling:PutInstanceInService",
        "ec2:Describe*"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}

iv.           Next, we are also going to edit the trust relationship for this IAM role by adding the following relationship policy.

// Policy Trust for Code Deploy
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "codedeploy.us-west-2.amazonaws.com",
          "codedeploy.us-east-1.amazonaws.com"
        ]
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

v.      Now we are going to create another IAM role for our EC2 instance. For this we click on create new role by clicking on “Roles” tab, with some name “EC2CodeDeploy”.
vi.              Then, select EC2 and click on Next.
vii.         Then, we are going to add a custom policy to this Role. Add the following policy document to this role.

// Instance Role for EC2 Instance
{
    "Version": "2012-10-17",
    "Statement": [  
      {    
          "Action": [      
              "s3:Get*",      
              "s3:List*"    
          ],    
          "Effect": "Allow",    
          "Resource": "*"  
      }
    ]
}

viii.         Finally click on ‘Create Role’.

  3.    Now we are going to create and launch a new EC2 instance by going under the services and click on EC2. Then click Launch a New Instance.

  4.    For this tutorial, we’ll select “Amazon Linux AMI” because it comes pre-installed with AWS CLI.

  5.    Next, we are going select the instance type according to our requirements.

  6.    Then click on the button “Configure Instance Details”.

 7. Now under IAM we are going to select the EC2 role we create i.e. EC2CodeDeploy.

 8.  Next the storage is fine as default and then we can tag the instance by adding some value to the Key name like “AWS CodeDeploy”.

 9.  Next configure the Security Group to allow all inbound-outbound traffic, leave it as default and proceed further. Finally click on Review and Launch button. 

 10.   Now select the key pair for establishing the SSH or create a new one if not already created and wait for the instance to launch.

 11. Once the instance has been launched successfully, we are going to connect to via SSH. For this go to your instance under EC2 and click on connect.

 12. After you are successfully connected to your EC2 instance, we need to configure something and install Code Deploy agent in our EC2 instance.

 13. Run the following commands on to your EC2 instance by following the instruction sheet provided.

Instruction Sheet
i.                   When server is booted run the following commands as root.
yum -y update
yum install -y aws-cli
cd /home/ec2-user

ii.                 Here you will setup your AWS access, secret, and region.
aws configure
aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1
chmod +x ./install

iii.              This is simply a quick hack to get the agent running faster.
sed -i "s/sleep(.*)/sleep(10)/" install

        ./install auto

iv.              Verify it is running.
service codedeploy-agent status

 14. Next, we are going to open the CodeDeploy in the AWS console by clicking the services tab and finding the option for CodeDeploy under Developer tools.

 15.  We will click on “Get Started” and then select the “Custom Deployment” option and click next.

 16.  And then under the Create New Application window, we would need to add the entries to the fields provided.
Application Name: AWSCodeDeploy
Deployment Group: AWSCodeDeploy
Add the Tags: Key- name, Value – AWS CodeDeploy
Deployment Configuration: CodeDeployDefault.OneAtATime (fine for now or select according to your requirements)
Service Role ARN: CodeDeploy (It’s the first role we created earlier)
Finally click on Create Application.

 17.   Next click on the CodeDeploy application we just created and then click on Actions button then “Deploy New Revision”.

 18. Inside the “Create New Deployment” window, add the entries to the following fields.
Application Name: AWSCodeDeploy
Deployment Group: AWSCodeDeploy
Revision Type: Select the option for Github
Repository Name: Enter the name of the repository in the following format- username/repository_name
shoobomb/AWS-CodeDeploy-Example
Commit ID: In the commit id, enter the 40 characters commit id you can find on your Github repository page.
Deployment Config: CodeDeployDefault.OneAtATime

Note- The Github repository which contains the code to deploy should also contain an ‘appspec.yml’ file which defines the application specification for how the application would be deployed on CodeDeploy. You can have a look at the directory structure of the application code and the appspec.yml file in the following Github repository which also contains a sample code to be deployed.

More details on how about creating your own ‘appspec.yml’ file or plan a revision for your own project, you can have a look at the AWS Documentation for the same.

 19. Finally you can click on ‘Deploy’ and wait for this revision to get successfully deployed on the EC2 instance. You can check the ‘Status’ field to check whether the revision was successfully deployed or not. 

  20.  If you see the Status field value as Succeeded, it means your revision has been successfully deployed on your EC2 instance. To check for the same, you can go to the EC2 tab and look out for running instances, then check for the Public DNS or the public IP to check the changes made to the new revision deployed.

  21. That’s it about setting up continuous deployment using CodeDeploy, you can explore more features by going to the CodeDeploy on AWS console.



Thursday, March 17, 2016

Step by Step Tutorial To Setup MySQL Database Server on Microsoft Azure

Setting Up the MySQL Database Server on Microsoft Azure Virtual Machine...
Following are the steps -
1. Login to the Azure Management Portal by going to the following link –
Enter the your user credentials –
Username: your username
Password: your password

2. Go to the Virtual Machines window by clicking on the ‘Virtual Machines’ tab on the left side of the Azure Management Portal.

3.  Click on the ‘New’ button at the bottom to create a new virtual machine.

4. Inside the ‘New’ Grid window click on ‘Compute’, then ‘Virtual Machine’ and finally ‘Quick Create’. This would open up a small form to enter the details of the Virtual Machine.

5. In The ‘DNS Name’ text-field, enter the name of the virtual machine of your choice which has the extension of .cloudapp.net (anyname.cloudapp.net).

6. In the ‘Image’ section, select the copy of the virtual machine image you want to run (Windows Server 2012 R2 Datacenter).

7. Now select the ‘Size’ you want to allocate to the Virtual Machine in terms of CPU cores and the memory (RAM).

8. Next enter the user credentials (Username: anyusername, Password: anypassword).

9. At last select the ‘Region/Affinity Group’ from the list of regions to opt for a particular region where the virtual machine would reside (East US).

10. Finally click on the ‘Create Virtual Machine’ button. Now you can see a notification saying “Creating Virtual Machine…”

11. Once the Virtual Machine is configured and ready, you’ll see a notification saying “Successfully created virtual machine vm_name”.

12.  Now you can check the ‘Status’ of the Virtual Machine changed to ‘Running’ in the Virtual Machine window.

13. When the Virtual Machine is in the Running state, you can click on the Virtual Machine and navigate to various tabs like Dashboard, Monitor, Endpoints & Configure to check and edit the details of the VM.

14. Now for connecting to the Virtual Machine, go to the Dashboard. In the dashboard window, click on the “Connect” button on the Bottom.

15. Clicking on the ‘Connect’ button, a .rdp (remote desktop protocol) file will be downloaded. Save the file on the personal computer for establishing the connection to the Virtual Machine from your windows machine.

16. Open the .rdp file downloaded from Azure. It would ask for user credentials. Enter the user credentials mentioned earlier in the process of configuring the Virtual Machine. Also a security certificate prompt will open, click on OK to trust the source and wait for the Remote Desktop Connection to commence. In a few seconds you will be inside your Virtual Machine (Windows Server 2012 R2 Datacenter).

17. Now inside your Virtual Machine, download the MySQL Community Server from the following link –

18. Open the installation file for MySQL and start the installation process. Click on Typical mode for installation. And wait for it to complete the installation.

19. Click on Finish to complete the MySQL installation. Next the MySQL Configuration wizard will open.

20. Click on next. Then check the option for ‘Standard’ Installation, click on Next.

21. Now check the option for both ‘Install as a Windows Service’ and ‘Include Bin Directory in Windows PATH’.

22. Now enter the password for the MySQL server, then click on Next.

23. Now click on Execute to commit the configurations and wait for it to complete.

24. Click on Finish to complete. Now the database server is ready.

25. To check the connection of the database server from a remote system/computer execute the following command from MySQL Command Line Tool installed on the remote system –
mysql –u username –p –h anyname.cloudapp.net
password: your password

26. After this you are into the MySQL database server hosted on the Microsoft Azure Virtual Machine.


Friday, September 18, 2015

Cloud Security : How To Secure The Multi-Tenant Environment Of Cloud ?

Learn How To Secure The Cloud Multi-Tenant Environment Using Hypervisor Based Segmentation And Database Based Segmentation Techniques...



Hypervisor Based Segmentation

Hypervisor based Segmentation is very important aspect of securing the multi-tenant environment generally when the cloud offering is IAAS i.e. Infrastructure as a service.
Hypervisor is generally a middleware between the underlying hardware and Virtual Machine and is involved in the entire virtualization process and also managing the VMs. In IAAS the multiple tenants or the customers are given the VMs which are generally the file servers, storage servers, databases, application servers, etc. The major risk or vulnerability arises in the architecture of co-residing of all the VMs of different tenants. There is always a threat of unauthorized access, data breaches, MITM – Man in The Middle Attacks, malware injection and various other attacks. Isolation and segmentation in VM should be done for the data integrity and confidentiality. But as Hypervisor is the main source which is involved making calls to and fro from VM and the underlying hardware, if segmentation is done at this level then none other option can prove out to be better for securing the multi-tenant 
infrastructure of the cloud.


Securing Cloud...:)


Database Based Segmentation


Database based segmentation is needed when the cloud offering is mainly SAAS i.e. Software as a service. In a multitenant environment when the customers are using the same instance of the software there is chance that the records or the data associated with that software is stored in the same database or inside the same table where the other tenant’s data is also stored in. So there arises a major risk when the data is just identified the tenant id and stored in the table or the same database. So one thing that can be done to avoid this type of risk is to encrypt the data inside the database, if by means it is compromised it would be very difficult to decipher it. Secondly the Access Control and Role mechanism should be established that ensures only those rows and fields to be accessed and modifiable in accordance with the security policies.


So That's all about securing multi-tenant environment of Cloud. This was one of my college assignments of Cloud Security ;)

Spread Knowledge!!!




Wednesday, August 19, 2015

How To Find Misplaced Mobile Phone While On Silent Mode

Learn How To Find Your Misplaced Android Device/Mobile Phone While On Silent Mode...


This is a serious problem which most of us face with our daily usage of mobile phones. Mobile phones or I must say Smartphones have really become an important part in an individual's life today. Smartphone users are increasing worldwide at a very rapid rate and as a matter of fact, according to eMarketer a total of 4.55 billion people worldwide shall be using a mobile phone as of 2014. That's a huge number right? and its expected to increase many folds by the year 2017.

While smartphones makes our everyday living smart and smooth, but at times its the other way around too. What if your mobile phone is on silent mode and you misplaced it. Misplaced in a sense, you kept it under a pillow or under a table, And ringing from another phone also proves to be futile. This situation would really crap your mind out when in hurry.

So, there is an easy way for Android Users to make their mobiles ring even when in silent mode. Cool Rite, I was too excited when I heard about this feature by google. But some limitations are also there. Most importantly your device should be connected to internet. If not, this particular feature to recover your misplaced phone wont work. So Lets see how to find our misplaced phone while its on silent mode. Follow these simple steps -

1. Open Google Play Store From Any Other Device.
    https://www.play.google.com/store

2. Sign In to Google Play Store With Your Same Account You Used For Registration/Activation Of  Your Mobile Phone.

3. From Settings Tab, Go To Android Device Manager.
    (At top most right you'll find the settings tab)

4. Inside Android Device Manger, You'll See Your Registered Device. Click On Ring. In A Matter Of  Seconds Your Mobile Phone Will Start Ringing If Connected To Internet.


                                             
Yeah..Finally He got his
Yeahh!! Finally He Got His Mobile...;)

Damn Cool, I tried it yesterday and it works like charm. And There are lot of other evil things that can be done with this Android Device Manager. A lot of hacks. Wait For my Next Post on Hacking Smartphones Using Android Device Manager. Till Then Enjoy This Feature and Spread it to people around.
                                                     
GOODLUCK! PEACE!




Monday, August 17, 2015

Pakistani Hackers Responded Back With A Bang By Defacing Rajasthan ACB Website & The Cyber War Continues

Pakistani Hackers responded back just a day after Indian Hackers Took Down 100+ Pakistani Websites on the Indian Independence Day - 15 August 2015


This Cyber War between the two nations seems to grow only over the time to come, as the current scenario says. This time some Pakistani Hackers Took Down Rajasthan Anti Corruption Bureau website and posted several messages, photos and cartoons on the homepage of the website. The site is currently down for recovery.

The ACB website is currently down for recovery

The message mainly focussed on telling the Indians that Pakistan won the Kargil War. Several photos depicting the Kargil War were posted on the website. Also cartoon of Pakistan's former President Pervez Musharraf was posted depicting the indian army left the bodies of indian soldiers claiming that the Pakistan won the Kargil War. Also cartoon of Indian Prime Minister Narendra Modi was also posted depicting him as if he has been wounded by the world of politics.


Homepage of defaced ACB Rajasthan website

You can find the all the pics of the defaced homepage of the ACB website on this link

Only God knows when the relationship between the two countries will improve and finally be united  to lead the world to a peaceful place to live in. We can only hope for the best and pray to almighty to end all these physical wars and cyber wars between the two nations India and Pakistan.

   SPREAD PEACE !!!


100+ Pakistani Websites Defaced By Indian Hackers On India's 69th Independence Day

Indian Hackers bring down more than 100 Pakistani websites on Independence Day...

Forget about war and clashes between the two nations India and Pakistan, FYI these two nations are also a part of ever continuing and never ending Cyber War, which has been seen from years now. 
As a part of fact these two nations have a record of defacing each other websites on their special occasion of independence day as both the nation have a gap of just one day in their independence day (Pakistan's Independence Day - 14 August, India's Independence Day - 15 August).

On Indian Independence Day of 2013, It was seen that 6596 Pakistani websites were defaced by the Indian Hackers as a payback. And talking about the present year. Pakistani hackers attacked on Indian websites on their independence day i.e 14 August and then on 15 August (which is celebrated as india's independence day) Indian Hacker Group named "HELL SHIELD HACKERS" gave them a little payback by defacing 100+ Websites displaying different messages on their websites, paying a tribute to Indian Javans on this auspicious occasion. 

Hell Shield HACKERS group is one of the anonymous hacker groups of india, which is currently most active "Black Hat" team in India with founder L@z@rus, and other members include psychotic_overloadD, indi-g3@r, Mr.404 and poison. (As from Hindustan Times article).


Webpage of one of the defaced pakistani website  

Many of the wesbites are still defaced while some are down for recovery. You can have a look at the complete list of websites defaced by the Indian Hacker Group "HELL SHIELD HACKERS" on the following link - 

Hope this cyber war ends soon and their relationship with each other improve so that both the nations can live happily & peacefully , and maintain the nationhood among them. PEACE !!




Friday, July 10, 2015

Microsoft Finally Rolling Out Windows 10 Upgrade Notifications To All The Licensed Windows 7,8 Users

Windows 7 & Windows 8 are prompted to reserve their free copies of Windows 10...


Finally today when i started my PC and connected to internet, after some time i got this icon at the bottom of the screen saying "Get Windows 10".


This is the window icon you see in your licensed Windows 7,8 to upgrade to Windows 10


The prompt is for users to reserve their free copies that would ultimately will be rolling out from 29 July onwards. This is also to get users familiarize with the looks and feels of Windows 10. You can also check the video showing you all the features and looks of the most awaited Windows 10.

Prompt box for Windows 10 upgrade

Video by Microsoft to get the feel of Windows 10


You would require around 3GB of internet data to download and upgrade to Windows 10. Rest all as it says, is totally FREE. 

But wait is it legit saying that its free... How free it really is?? Microsoft seems silent about this. And you never know Microsoft starts charging for incremental upgrades or updates after some time period. You indeed never know as of you...!!!

Still the curiosity is at its peak and we all would definitely wanna try this beast from Microsoft. Hope it proves out the same too. ;)




So what are you waiting for!! Hit that button to reserve you free copy now...!!!







Monday, April 27, 2015

Anonymous India Brings Down The TRAI Website For Releasing 1 Million Email Ids In Public

Anonymous India takes down the TRAI website earlier today for exposing the email ids of around 1 million people who responded to TRAI for the Net Neutrality Cause

UPDATED : The TRAI website is up and functioning now but still they haven't done anything with the email ids, you can still find the list of email ids on comments page.

TRAI asked the users to fill in the form regarding the Net Neutrality issue in India to get the feedback and reviews of the public for the same. And around million users responded to the same. But it was not at all a legit decision from a government organisation exposing the list of all the users with their emails in public though their website.


As they say, they are watching our every move. Finally, Anonymous India took action in order to protect and safeguard the privacy of around million users of India and attacked the website of TRAI (www.trai.gov.in) earlier today using their ways of DDOS.

You can have a look at the tweets made by the Anonymous India and the public on the anonOpsIndia twitter page






In the evening, the website was finally up and functioning well. But it seemed there is no effect to TRAI of the attack made by Anonymous India & You can still find the list of the email ids on the website of TRAI.

What can the general public expect from such government organization who is not even worried about the users privacy and wish to work for them for the cause of Net Neutrality. This shows that one DDOS attack was not enough for the TRAI. Lets see what action Anonymous India further against TRAI to protect the privacy of the indian public..

Have a look at the tweets after the TRAI website was functioning.





For more tweets and latest updates regarding this, stay tuned to the AnonOpsIndia page(opindia_revenge) on twitter






Saturday, April 4, 2015

No More Private Profile Pictures on Facebook | Latest April 2015

Facebook has discontinued with the feature of Private Profile Pictures with the new settings and now you can view private profile pics of anyone very easily....

No More Private Profile Pics in Facebook from now onwards. Even if you set your profile picture to 'Only Me' in the Settings Tab of the profile pic, your Profile Picture is still visible to everyone when they click on it. Don't think that it's private now. Facebook has changed their policies or what or may be its a flaw ( i have already reported). But what i think is its done purposely by the Facebook team.

I can't say why they have removed that feature of Private Profile Picture though the option of Visible to 'Only Me' is still there.

The new settings are as such that when you click on the profile picture after visiting the profile of a person who has enabled the Only Me Privacy on his profile pic, unlike before it just opens as usual just you don't get the like section and comment section at the right hand side of the image. Otherwise the picture opens as usual and you can easily download the private profile picture just by right clicking on it, and saving it to the device.



This the private profile pic of one of my friend which i can easily open just by clicking on it




 No comment or like section at RHS of the pic, but i can easily save the pic just by right clicking it



Earlier for a non-geek, the private profile picture won't open only and that guy wouldn't be able to view the picture though a geek would have opened it using some tricks with the Facebook's Graph API. But now may it be a Geek or Non-Geek, its open to all to view the private profile pictures on facebook.

Again Privacy of the users being compromised, that's it. Can't say what Facebook has thought of before doing this change ?? I have already reported it to facebook, let's see if i get a reply and their statement regarding this privacy change (I'm sure i wont get a reply back...lol :D)