Download as pdf or txt
Download as pdf or txt
You are on page 1of 74

Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar

S105665GC20
Activity Guide
ind
om
Gh
os
h

Foundations
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om

Learn more from Oracle University at education.oracle.com


Gu )
ide ha
. sa
no

Oracle Cloud Infrastructure


n-
tra
ns
fe
ra
b le
Copyright © 2023, Oracle and/or its affiliates.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Disclaimer

This document contains proprietary information and is protected by copyright and other intellectual property
laws. The document may not be modified or altered in any way. Except where your use constitutes "fair use"
under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce,
publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.

The information contained in this document is subject to change without notice and is not warranted to be

le
error-free. If you find any errors, please report them to us in writing.

b
ra
Restricted Rights Notice

fe
ns
If this documentation is delivered to the United States Government or anyone using the documentation on
behalf of the United States Government, the following notice is applicable:

tra
n-
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any
programs embedded, installed or activated on delivered hardware, and modifications of such programs) and

no
Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are
"commercial computer software" or "commercial computer software documentation" pursuant to the applicable

. sa
Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction,
duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i)

ide ha
Oracle programs (including any operating system, integrated software, any programs embedded, installed or
activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation

Gu )
is om
and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the
applicable contract. The terms governing the U.S. Government's use of Oracle cloud services are defined by the
th .c
applicable contract for such services. No other rights are granted to the U.S. Government.
e ail

Trademark Notice
us m
to @g

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
their respective owners.
se sh

Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
en ho

used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the
AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark
lic mg

of The Open Group.


do

Third-Party Content, Products, and Services Disclaimer


rin

This documentation may provide access to or information about content, products, and services from third
(a

parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any
kind with respect to third-party content, products, and services unless otherwise set forth in an applicable
h
os

agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss,
costs, or damages incurred due to your access to or use of third-party content, products, or services, except as
Gh

set forth in an applicable agreement between you and Oracle.


om
ind
Ar

2005182023
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Table of Contents

Identity and Access Management (IAM): Create IAM Components - With Identity Domains Enabled
........................................................................................................................................................... 5

le
Get Started ..................................................................................................................................... 6

b
ra
Create a Compartment (With Identity Domains Enabled) .............................................................. 8

fe
Create a User (With Identity Domains Enabled) ............................................................................ 9

ns
Create a Group, and Add a User to the Group (With Identity Domains Enabled) ......................... 10

tra
Create a Policy (With Identity Domains Enabled) .......................................................................... 11

n-
Create a Dynamic Group (With Identity Domains Enabled) ........................................................... 12

no
Identity and Access Management (IAM): Create IAM Components - Without Identity Domains

. sa
Enabled ............................................................................................................................................. 13

ide ha
Get Started ..................................................................................................................................... 14
Create a Compartment (Without Identity Domains Enabled) ......................................................... 16

Gu )
is om
Create a User (Without Identity Domains Enabled) ....................................................................... 17
Create a Group, and Add a User to the Group (Without Identity Domains Enabled) .................... 18
th .c
e ail

Create a Policy (Without Identity Domains Enabled) ..................................................................... 19


us m

Create a Dynamic Group (Without Identity Domains Enabled) ...................................................... 20


to @g

Networking—Virtual Cloud Network: Create and Configure a Virtual Cloud Network ............. 21
se sh

Get Started ..................................................................................................................................... 22


en ho

Create a Virtual Cloud Network ...................................................................................................... 24


lic mg

Networking: OCI Load Balancer ..................................................................................................... 27


Get Started ..................................................................................................................................... 28
do

Create a Virtual Cloud Network ...................................................................................................... 30


rin

Create Two Compute Instances (Backend Servers) ...................................................................... 31


(a

Create a Load Balancer.................................................................................................................. 34


h
os

Compute: Create a Web Server on an OCI Compute Instance .................................................... 37


Gh

Get Started ..................................................................................................................................... 38


Launch Cloud Shell ........................................................................................................................ 39
om

Generate SSH Keys ....................................................................................................................... 40


ind

Create a Virtual Cloud Network and Its Components .................................................................... 42


Create a Compute Instance ........................................................................................................... 45
Ar

Install an Apache HTTP Server on the Instance ............................................................................ 47


Object Storage: Create and Manage OCI Object Storage ............................................................ 49
Get Started ..................................................................................................................................... 50
Create an Object Storage Bucket ................................................................................................... 51
Upload an Object to a Bucket ......................................................................................................... 53

Copyright © 2023, Oracle and/or its affiliates.

Oracle Cloud Infrastructure Foundations – Table of Contents iii


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Block Storage: Create, and Attach a Block Volume ..................................................................... 55


Get Started ..................................................................................................................................... 56
Create a Virtual Cloud Network and Its Components .................................................................... 58
Create a VM Instance ..................................................................................................................... 60
Create a Block Volume ................................................................................................................... 63
Attach a Block Volume to a Compute Instance .............................................................................. 64

b le
Security: Configure Security Zones Using Maximum Security Zones ....................................... 67

ra
Get Started ..................................................................................................................................... 68

fe
ns
Set Up Security Zone with Maximum Security Recipe ................................................................... 70

tra
View the Security Zone Policies Attached with a Created Security Zone ...................................... 71
Verify Creating a Bucket in an Assigned Compartment Using a Oracle-Managed Key ................ 72

n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

iv Oracle Cloud Infrastructure Foundations – Table of Contents


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
ide ha
Lab 1-1 Practices
. sa
no
n-
tra
ns
Identity and Access

fe
ra
b le
IAM Components - With
Identity Domains Enabled
Management (IAM): Create
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) lets you control who
has access to your cloud resources.

leb
In this lab, we will help you create a compartment, group, user, and policy. We will also provide

ra
the steps to create a dynamic group.

fe
ns
Note: Below instructions are for accounts with Identity Domains enabled.

tra
n-
In this lab, you’ll:

no
Create a compartment

. sa
a.

ide ha
b. Create a user

Gu )
c. is om
Create a group, and add a user to the group
th .c
e ail

d. Create a policy
us m
to @g

e. Create a dynamic group


se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

6 Identity and Access Management: Create IAM Components - With Identity Domains Enabled
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )

Copyright © 2023, Oracle and/or its affiliates.


ide ha
. sa

Identity and Access Management: Create IAM Components - With Identity Domains Enabled
no
n-
tra
ns
fe
ra
b le

7
Create a Compartment (With Identity Domains Enabled)
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

A compartment is a collection of related resources. Compartments are fundamental


components of OCI and are used for organizing and isolating your cloud resources.

In this practice, you will learn how to create a compartment.

le
Tasks

b
ra
fe
1. Sign in to the OCI Console.

ns
tra
2. Open the Main Menu and select Identity & Security. Under Identity,

n-
click Compartments. A list of the compartments to which you have access appears.

no
3. Click Create Compartment.

. sa
ide ha
4. Do the following:

Gu )
a. is om
Name: Enter a unique name for the compartment. The name must be unique across
th .c
all the compartments in your tenancy.
e ail
us m

b. Description: Enter a compartment-related description.


to @g

c. Parent Compartment: The compartment you are in appears by default.


se sh
en ho

5. Click Create Compartment. The Child Compartment now appears in the list of
lic mg

compartments.
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

8 Identity and Access Management: Create IAM Components - With Identity Domains Enabled
Create a User (With Identity Domains Enabled)
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

A user is an individual employee or system that needs to manage or use your


company’s OCI resources.

In this practice, you’ll learn how to create a user.

le
Tasks

b
ra
fe
1. Open the Main Menu and select Identity & Security. Under Identity, click Domains. A

ns
list of domains in your tenancy appears.

tra
n-
2. Select the Domain that is allotted to you. Otherwise, you can click on the Default domain.

no
3. Under Identity domain, click Users. A list of the users in your domain appears.

. sa
ide ha
4. Click Create User.

Gu )
5. Enter the following: is om
th .c
a. First Name: Enter first name of user.
e ail
us m

b. Last Name: Enter last name of user.


to @g
se sh

c. Username/Email: Enter an email address for the user.


en ho

d. Check the Use the same email address as the username. Do not select the
lic mg

Assign cloud account administrator role check box.


do
rin

6. Click Create. The user now appears in the list of users.


(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Identity and Access Management: Create IAM Components - With Identity Domains Enabled 9
Create a Group, and Add a User to the Group (With
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Identity Domains Enabled)


A group is a collection of users who need the same type of access to a particular compartment
or set of resources.

le
In this practice, you’ll learn how to create a group, and add a user to a group.

b
ra
Tasks

fe
ns
Open the Main Menu and select Identity & Security. Under Identity, click Domains. A

tra
1.
list of domains in your tenancy appears.

n-
no
2. Click on the Default domain.

. sa
3. Under Identity domain, click Groups. A list of the groups in your domain appears.

ide ha
Gu )
4. Select the Administrators group.
is om
th .c
5. Click Assign User to Groups.
e ail

Select the user created earlier from the Users drop-down list, and then click Add. The user
us m

6.
now appears in the group.
to @g
se sh

7. Use the breadcrumb trail to go back to the Groups page and click Create Group.
en ho

8. Enter the following:


lic mg
do

a. Name: Enter a unique name for the group.


rin

b. Description: Enter a group-related description.


(a
h

9. Click Create. The group now appears in the list of groups.


os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

10 Identity and Access Management: Create IAM Components - With Identity Domains Enabled
Create a Policy (With Identity Domains Enabled)
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

A policy is a document that specifies who can access which resources, and how.

In this practice, you’ll learn how to create a policy.

Tasks

leb
ra
1. Open the Main Menu and select Identity & Security. Under Identity, click Policies.

fe
ns
2. Click Create Policy.

tra
Enter the following:

n-
3.

no
a. Name: Enter a unique name for the policy.

. sa
b. Description: Enter a policy-related description.

ide ha
Gu )
c. Compartment: If you want to attach the policy to a compartment other than the one
is om
you’re viewing, select it from the drop-down list. Remember, where the policy is
th .c
attached controls who can later modify or delete it.
e ail
us m

In the Policy Builder section, click Show manual editor and enter the policy statement.
to @g

4.
se sh

Note: A sample statement would look like the following:


en ho

allow group <group_name> to manage virtual-network-family in


lic mg

compartment <compartment_name>
do

5. Click Create. The policy now appears in the list of policies.


rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Identity and Access Management: Create IAM Components - With Identity Domains Enabled 11
Create a Dynamic Group (With Identity Domains
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Enabled)
A dynamic group is a special type of group that contains resources, such as compute
instances, which match rules that you define. This means that group membership can change
dynamically as matching resources are created or deleted. These instances serve as “principal”

le
actors and can make API calls to services according to policies that you write for the dynamic

b
ra
group.

fe
ns
In this practice, you’ll learn how to create a dynamic group.

tra
Tasks

n-
no
1. Open the Main Menu and select Identity & Security. Under Identity, click Domains. A

. sa
list of domains in your tenancy appears.

ide ha
2. Click on the Default domain.

Gu )
is om
3. Under Identity domain, click Dynamic Groups.
th .c
e ail

4. Click Create Dynamic Group.


us m
to @g

5. Enter the following:


se sh

a. Name: Enter a unique name for the group. The name must be unique across all groups
en ho

in your tenancy, including dynamic groups and user groups.


lic mg

b. Description: Enter a friendly description.


do

6. Enter the Matching Rules. Resources that meet the rule criteria are members of the
rin

dynamic group.
(a
h

a. Rule 1: Enter a rule by following the guidelines in https://docs.oracle.com/en-


os

us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#Writing
Gh

https://docs.oracle.com/en-
us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm.
om

Note: You can manually enter the rule in the text box or launch the rule builder.
ind

− For example, to include all instances that are in a specific compartment, add a rule
Ar

with the following syntax:


instance.compartment.id = '<compartment_ocid>'

b. Enter additional rules as needed. To add a rule, click +Additional Rule.

7. Click Create. The dynamic group now appears in the list of dynamic groups.

Copyright © 2023, Oracle and/or its affiliates.

12 Identity and Access Management: Create IAM Components - With Identity Domains Enabled
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
ide ha
Lab 1-2 Practices
. sa
no
n-
tra
ns
Identity and Access

fe
ra
b le
Identity Domains Enabled
Management (IAM): Create
IAM Components - Without
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) lets you control who
has access to your cloud resources.

leb
In this lab, we will help you create a compartment, group, user, and policy. We will also provide

ra
the steps to create a dynamic group.

fe
ns
Note: Below instructions are for accounts without Identity Domains enabled.

tra
n-
In this lab, you’ll:

no
Create a compartment

. sa
a.

ide ha
b. Create a user

Gu )
c. is om
Create a group, and add a user to the group
th .c
e ail

d. Create a policy
us m
to @g

e. Create a dynamic group


se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

14 Identity and Access Management: Create IAM Components - Without Identity Domains Enabled
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )

Copyright © 2023, Oracle and/or its affiliates.


ide ha
. sa
no

Identity and Access Management: Create IAM Components - Without Identity Domains Enabled
n-
tra
ns
fe
ra
b le

15
Create a Compartment (Without Identity Domains
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Enabled)
A compartment is a collection of related resources. Compartments are fundamental
components of OCI and are used for organizing and isolating your cloud resources.

le
In this practice, you will learn how to create a compartment.

b
ra
Tasks

fe
ns
Sign in to the OCI Console.

tra
1.

n-
2. Open the Main Menu and select Identity & Security. Under Identity,

no
click Compartments. A list of the compartments to which you have access appears.

. sa
3. Under Child Compartment, click Create Compartment.

ide ha
4. Do the following:

Gu )
a.
is om
Name: Enter a unique name for the compartment. The name must be unique across
th .c
all the compartments in your tenancy.
e ail
us m

b. Description: Enter a compartment-related description.


to @g

Parent Compartment: The compartment you are in appears by default. To choose


se sh

c.
another compartment in which to create this compartment, select from the drop-
en ho

down list.
lic mg
do

5. Click Create Compartment. The Child Compartment now appears in the list of
compartments.
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

16 Identity and Access Management: Create IAM Components - Without Identity Domains Enabled
Create a User (Without Identity Domains Enabled)
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

A user is an individual employee or system that needs to manage or use your


company’s OCI resources.

In this practice, you’ll learn how to create a user.

le
Tasks

b
ra
fe
1. Open the Main Menu and select Identity & Security. Under Identity, click Users. A list of

ns
users in your tenancy appears.

tra
n-
2. Click Create User.

no
3. Enter the following:

. sa
ide ha
a. Name: Enter a unique name or email address for the user.

Gu )
is om
b. Description: This value could be the user’s full name, a nickname, or any other
descriptive information.
th .c
e ail

c. Email: Enter an email address for the user. This email address is used for
us m
to @g

password recovery.
se sh

4. Click Create. The user now appears in the list of users.


en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Identity and Access Management: Create IAM Components - Without Identity Domains Enabled 17
Create a Group, and Add a User to the Group (Without
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Identity Domains Enabled)


A group is a collection of users who need the same type of access to a particular compartment
or set of resources.

le
In this practice, you’ll learn how to create a group, and add a user to a group.

b
ra
Tasks

fe
ns
Open the Main Menu and select Identity & Security. Under Identity, click Groups. A list

tra
1.
of the groups in your tenancy appears.

n-
no
2. Click on the Administrators group.

. sa
3. Click Add User to Group.

ide ha
Gu )
4. Select the user created earlier from the Users drop-down list, and then click Add. The user
now appears in the group.
is om
th .c
e ail

5. Use the breadcrumb trail to go back to the Groups page and click Create Group.
us m
to @g

6. Enter the following:


se sh

a. Name: Enter a unique name for the group.


en ho
lic mg

b. Description: Enter a group-related description.


do

7. Click Create. The group now appears in the list of groups.


rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

18 Identity and Access Management: Create IAM Components - Without Identity Domains Enabled
Create a Policy (Without Identity Domains Enabled)
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

A policy is a document that specifies who can access which resources, and how.

In this practice, you’ll learn how to create a policy.

Tasks

leb
ra
1. Open the Main Menu and select Identity & Security. Under Identity, click Policies.

fe
ns
2. Choose a compartment.

tra
A list of the policies in the compartment you’re currently viewing appears.

n-
3.

no
4. Click Create Policy.

. sa
Enter the following:

ide ha
5.

Gu )
a. Name: Enter a unique name for the policy.
is om
th .c
b. Description: Enter a policy-related description.
e ail
us m

c. Compartment: If you want to attach the policy to a compartment other than the one
to @g

you’re viewing, select it from the drop-down list. Remember, where the policy is
se sh

attached controls who can later modify or delete it.


en ho

6. In the Policy Builder section, click Show manual editor and enter the policy statement.
lic mg
do

Note: A sample statement would look like the following:


rin

allow group <group_name> to manage virtual-network-family in


(a

compartment <compartment_name>
h
os

7. Click Create. The policy now appears in the list of policies.


Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Identity and Access Management: Create IAM Components - Without Identity Domains Enabled 19
Create a Dynamic Group (Without Identity Domains
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Enabled)
A dynamic group is a special type of group that contains resources, such as compute
instances, which match rules that you define. This means that group membership can change
dynamically as matching resources are created or deleted. These instances serve as “principal”

le
actors and can make API calls to services according to policies that you write for the dynamic

b
ra
group.

fe
ns
In this practice, you’ll learn how to create a dynamic group.

tra
Tasks

n-
no
1. Open the Main Menu and select Identity & Security. Under Identity, click Dynamic

. sa
Groups.

ide ha
2. Click Create Dynamic Group.

Gu )
is om
3. Enter the following:
th .c
e ail

a. Name: Enter a unique name for the group. The name must be unique across all groups
us m

in your tenancy, including dynamic groups and user groups.


to @g

b. Description: Enter a friendly description.


se sh
en ho

4. Enter the Matching Rules. Resources that meet the rule criteria are members of the
dynamic group.
lic mg
do

a. Rule 1: Enter a rule by following the guidelines in https://docs.oracle.com/en-


us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm#Writing
rin

https://docs.oracle.com/en-
(a

us/iaas/Content/Identity/Tasks/managingdynamicgroups.htm.
h

Note: You can manually enter the rule in the text box or launch the rule builder.
os
Gh

− For example, to include all instances that are in a specific compartment, add a rule
with the following syntax:
om

instance.compartment.id = '<compartment_ocid>'
ind

b. Enter additional rules as needed. To add a rule, click +Additional Rule.


Ar

5. Click Create. The dynamic group now appears in the list of dynamic groups.

Copyright © 2023, Oracle and/or its affiliates.

20 Identity and Access Management: Create IAM Components - Without Identity Domains Enabled
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
ide ha Network
Lab 2-1 Practice
. sa
no
n-
tra
ns
fe
Network: Create and

ra
b le
Configure a Virtual Cloud
Networking—Virtual Cloud
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

In this practice, you will configure and deploy a Virtual Cloud Network (VCN).

A VCN is a software-defined network specific to your OCI tenancy or a compartment in a

b le
specified region.

ra
fe
Upon creation, a VCN automatically includes route tables, security lists (with default security

ns
rules), and a set of DHCP options. The VCN also has access to a DNS resolver.

tra
n-
A VCN that is launched with the OCI VCN Wizard tool automatically creates the following:

no
• Public and Private Subnets

. sa
• Internet Gateway (IG)

ide ha
• NAT Gateway (NAT)

Gu )
• Service Gateway (SG)
is om
• Two Route Tables (RT)
th .c
e ail

• Two Security Lists (SL)


us m

• One CIDR Blocks/Prefixes


to @g

• One DHCP Option


se sh

For more information about VCNs, see the OCI Networking Documentation:
en ho

https://docs.oracle.com/en-us/iaas/Content/Network/Concepts/landing.htm
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

22 Virtual Cloud Network: Create and Configure a Virtual Cloud Network


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

leb
ra
fe
ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
Prerequisites
e ail
us m

• You have access to the OCI Console.


to @g

Assumptions
se sh
en ho

• In this lab, we are considering US East (Ashburn, Region Key – IAD) as your region.
lic mg

• You must be familiar with navigating the OCI Console.


do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Virtual Cloud Network: Create and Configure a Virtual Cloud Network 23


Create a Virtual Cloud Network
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this lab, you will create a VCN and associated resources by using the VCN Wizard.

Tasks

1. Log in to the OCI Console.

b le
ra
2. In the Console ribbon at the top of the screen, click the Region icon to expand the menu.

fe
Ensure that you are in the correct region, US East (Ashburn).

ns
tra
3. Click the Main Menu, click Networking, and then click Virtual Cloud Networks.

n-
no
4. Click Start VCN Wizard.

. sa
5. Select the Create VCN with Internet Connectivity option, and then click Start VCN

ide ha
Wizard.

Gu )
6. Enter the following values: is om
th .c
Name: IAD-FA-LAB02-VCN-01
e ail
us m

Compartment: Select your <assigned compartment>.


to @g
se sh

7. Leave the default values for the remaining fields. Click Next.
en ho

8. Review and understand the list of resources that the OCI VCN Wizard will create. Notice
lic mg

that the wizard will configure CIDR block ranges for VCN IP addresses, and for the public
do

and private subnets. It will also set up security list rules and route table rules to enable
rin

basic access to the VCN.


(a

Click Create to start creating the VCN and its resources and wait for the VCN Wizard to
h

9.
os

successfully complete the VCN creation.


Gh

10. Click View Virtual Cloud Network to verify the creation of the VCN and its resources.
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

24 Virtual Cloud Network: Create and Configure a Virtual Cloud Network


You can see that the VCN is successfully created with the following components:
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

• VCN
• Public Subnet
• Private Subnet
• CIDR Blocks/Prefixes
• Route Tables

leb
• Internet Gateway

ra
fe
• Security Lists

ns
• DHCP Options

tra
• NAT Gateway

n-
• Service Gateway

no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Virtual Cloud Network: Create and Configure a Virtual Cloud Network 25


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

26
Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )

Copyright © 2023, Oracle and/or its affiliates.


ide ha
. sa
no
n-
tra
ns
fe
ra
b le

Virtual Cloud Network: Create and Configure a Virtual Cloud Network


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
Balancer

ide ha
Lab 3-1 Practice

. sa
no
n-
tra
ns
fe
ra
b
Networking: OCI Load

le
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

In this practice, you will configure a Public Load Balancer, including a set of two backend
compute instances.

leb
Load Balancer

ra
fe
The OCI Load Balancer provides automated traffic distribution from one entry point to

ns
multiple backend servers in your VCN. It operates at the connection level and balances

tra
incoming client connections to healthy backend servers. The service offers a load balancer

n-
with your choice of a regional public or private IP address and provisioned bandwidth.

no
. sa
Summary of Components for OCI Load Balancer Used in This Lab

ide ha
• Listener: A logical entity that checks for incoming traffic on the load balancer’s IP
address

Gu )

is om
Backend server: An application server responsible for generating content in reply to
th .c
the incoming traffic
e ail

• Backend set: A logical entity defined by a list of backend servers


us m
to @g

• Load-balancing policy: Tells the load balancer how to distribute incoming traffic to
the backend servers
se sh

• Health check: A test to confirm the availability of backend servers


en ho
lic mg

• Shape: The bandwidth capacity of the load balancer


do

In this lab, you will:


rin
(a

a. Create a Virtual Cloud Network


h
os

b. Create two compute instances


Gh

c. Create a load balancer


om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

28 OCI Load Balancer


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

leb
ra
fe
ns
tra
n-
no
. sa
Prerequisites

ide ha
Gu )
• You have access to the OCI Console.
is om
th .c
Assumptions
e ail
us m

• In this lab, we are considering US East (Ashburn, Region Key – IAD) as your region.
to @g

• You must be familiar with navigating the OCI Console.


se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

OCI Load Balancer 29


Create a Virtual Cloud Network
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will create a VCN and associated resources using the VCN Wizard.

Tasks

1. In the Console ribbon at the top of the screen, click the Regions icon to expand the menu.

leb
Ensure that you are in the correct region, US East (Ashburn).

ra
fe
2. From the Main Menu, select Networking, and then click Virtual Cloud Networks.

ns
tra
3. Click Start VCN Wizard.

n-
no
4. Select the Create VCN with Internet Connectivity option, and then click Start VCN
Wizard.

. sa
ide ha
5. Enter the following values:
Name: IAD-FA-LAB03-VCN-01

Gu )

is om
• Compartment: Select your assigned <compartment name>.
th .c
VCN CIDR Block: 172.17.0.0/16
e ail


us m

• Public Subnet CIDR Block: 172.17.0.0/24


to @g

• Private Subnet CIDR Block: 172.17.1.0/24


se sh

Leave the default values for the remaining fields. Click Next.
en ho

6.
lic mg

7. Review and understand the list of resources that the OCI VCN Wizard will create. Notice
do

that the wizard will configure CIDR block ranges for VCN IP addresses, and for the public
rin

and private subnets. It will also set up security list rules and route table rules to enable
(a

basic access to the VCN.


h
os

8. Click Create.
Gh

9. When complete, click View Virtual Cloud Network.


om

10. In the left navigation pane, under Resources, click Security Lists.
ind
Ar

11. Select Default Security List for IAD-FA-LAB03-VCN-01.

12. Click Add Ingress Rule.


a. For Source CIDR, enter 0.0.0.0/0.
b. For Destination Port Range, enter 80.
c. Click Add Ingress Rules.

Copyright © 2023, Oracle and/or its affiliates.

30 OCI Load Balancer


Create Two Compute Instances (Backend Servers)
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this lab, you will create two compute instances and configure them to provide web services.
They will serve as the backend servers, and will reside in a private subnet.

Task 1: Build the First Compute Instance

leb
1. In the Console ribbon at the top of the screen, click the Regions icon to expand the menu.

ra
Ensure that you are in the correct region, US East (Ashburn).

fe
ns
2. From the Main Menu, select Compute, and then click Instances.

tra
n-
3. In the left navigation pane, under List Scope, select your assigned <compartment name>.

no
4. Click Create Instance and enter the following values:

. sa
• Name: IAD-FA-LAB03-VM-01

ide ha
• Compartment: Your assigned <compartment name>

Gu )
• Placement: AD-1 is om
th .c
• Image: Oracle Linux 8
e ail

• Shape: Click Change Shape.


us m
to @g

• Instance Type: Virtual Machine


• Shape Series: Ampere
se sh

• Shape Name: VM.Standard.A1.Flex


en ho
lic mg

• Leave Number of OCPU at one.


• Leave Amount of memory (GB) at six.
do
rin

• Click Select Shape.


(a

• Networking:
h

• Primary network: Select existing Virtual Cloud Network.


os

• Virtual Cloud Network in <assigned compartment>: IAD-FA-LAB03-VCN-01


Gh

• Subnet in <assigned compartment>: Private Subnet-IAD-FA-LAB03-VCN-01


om

(regional)
ind

• Add SSH Key: No SSH Keys


Ar

• Click Show advanced options.


• On the Management tab, click Paste cloud-init script under Initialization script.

Copyright © 2023, Oracle and/or its affiliates.

OCI Load Balancer 31


• Copy and paste the following into the Cloud-init script field:
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

#!/bin/bash -x
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
yum -y install httpd
systemctl enable httpd.service
systemctl start httpd.service
firewall-offline-cmd --add-service=http

leb
firewall-offline-cmd --add-service=https

ra
systemctl enable firewalld

fe
systemctl restart firewalld

ns
echo Hello World! My name is IAD-FA-LAB03-WS-01>

tra
/var/www/html/index.html

n-
no
Note: This script configures and enables the compute instance’s firewall and httpd
processes.

. sa
ide ha
5. Click Create.

Gu )
is om
Note: The process will take approximately two minutes.
th .c
e ail
us m

Task 2: Build the Second Compute Instance


to @g
se sh

1. In the console ribbon at the top of the screen, click the Regions icon to expand the menu.
en ho

Ensure that you are in the correct region, US East (Ashburn).


lic mg

2. From the Main Menu, select Compute, and then click Instances.
do
rin

3. In the left navigation pane, under List Scope, select your assigned <compartment name>.
(a

4. Click Create Instance and enter the following values:


h
os

• Name: IAD-FA-LAB03-VM-02
Gh

• Compartment: Your assigned <compartment name>


om

• Placement: AD-1
ind

• Image: Oracle Linux 8


Ar

• Shape: Click Change Shape


• Instance Type: Virtual Machine
• Shape Series: Ampere
• Shape Name: VM.Standard.A1.Flex
• Leave Number of OCPU at one.

Copyright © 2023, Oracle and/or its affiliates.

32 OCI Load Balancer


• Leave Amount of memory (GB) at six.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

• Click Select Shape.


• Networking:
• Primary network: Select existing Virtual Cloud Network.
• Virtual Cloud Network in <assigned compartment>: IAD-FA-LAB03-VCN-01
• Subnet in <assigned compartment>: Private Subnet-IAD-FA-LAB03-VCN-01

leb
(regional)

ra
• Add SSH Key: No SSH Keys

fe
ns
• Click Show advanced options.

tra
• On the Management tab, click Paste cloud-init script under Initialization script.

n-
• Copy and paste the following into the Cloud-init script field:

no
#!/bin/bash -x

. sa
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT

ide ha
yum -y install httpd
systemctl enable httpd.service

Gu )
systemctl start httpd.service is om
th .c
firewall-offline-cmd --add-service=http
e ail

firewall-offline-cmd --add-service=https
us m

systemctl enable firewalld


to @g

systemctl restart firewalld


echo Hello World! My name is IAD-FA-LAB03-WS-02>
se sh

/var/www/html/index.html
en ho
lic mg

Note: This script configures and enables the compute instance’s firewall and httpd
processes.
do
rin

5. Click Create.
(a

Note: The process will take approximately two minutes.


h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

OCI Load Balancer 33


Create a Load Balancer
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this lab, you will create a Load Balancer, and configure the listener, the health check, and
backend set. You will then add a security rule to the security list of the private subnet.

Tasks

leb
1. From the Main Menu, select Networking, and then click Load Balancers.

ra
fe
2. In the left navigation pane, under List Scope, select your assigned <compartment name>.

ns
tra
3. Click Create Load Balancer.

n-
no
4. Select Load Balancer, click Create Load Balancer, and enter the following values:
• Load Balancer Name: IAD-FA-LAB03-LB-01

. sa
• Choose visibility type: Public

ide ha
• Assign a public IP address: Ephemeral IP Address

Gu )
• is om
In the Bandwidth section, under Shapes, select Flexible Shapes.
th .c
• Under Choose Networking, for the Virtual Cloud Network in <compartment
e ail

name>, select IAD-FA-LAB03-VCN-01 and for the Subnet in <compartment


us m

name>, select Public Subnet-IAD-FA-LAB03_VCN-01.


to @g

• Click Next.
se sh

• Under Choose Backends, select Weighted Round Robin.


en ho

• Click Add Backends.


lic mg

• Select both IAD-FA-LAB03-VM-01 and IAD-FA-LAB03-VM-02.


do

• Click Add Selected Backends.


rin
(a

• Leave all values at defaults in the Specify Health Check Policy section.
h

Note: The default values will add a TCP port 80 rule to the security list for your
os

private subnet.
Gh

• Click Next.
om

• On the Configure Listener page, enter the following values:


ind

• Listener Name: IAD-FA-LAB03-LISTENER-01


Ar

• Specify the type of traffic your listener handles: HTTP


Note: The Specify the port your listener monitors for ingress traffic value will
become 80.
• Click Next.
• On the Manage Logging page, set Error Logs to Not Enabled.

Copyright © 2023, Oracle and/or its affiliates.

34 OCI Load Balancer


5. Click Submit and wait for the status to become Active.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Note: The process will take approximately three minutes.

6. Verify that the Backend Set Health status is OK.

7. Locate and copy the Load Balancer’s IP Address.

leb
8. Paste the copied value into your browser’s address bar to visit the site.

ra
fe
9. A webpage stating Hello World! My name is IAD-FA-LAB03-WS-01 will appear.

ns
tra
10. Reload the page to see the other backend server has provided the message, Hello World!

n-
My name is IAD-FA-LAB03-WS-02.

no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

OCI Load Balancer 35


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

36
Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )

Copyright © 2023, Oracle and/or its affiliates.


ide ha
. sa
no
n-
tra
ns
fe
ra
b le

OCI Load Balancer


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu ) Instance
ide ha
Lab 4-1 Practices
. sa
no
n-
tra
ns
fe
ra
b le
Compute: Create a Web
Server on an OCI Compute
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

The Oracle Cloud Infrastructure (OCI) Compute lets you provision and manage compute hosts,
known as instances. You can launch instances as needed to meet your compute and

le
application requirements. In this lab, you will create a web server on a compute instance.

b
ra
In this lab, you will:

fe
Launch Cloud Shell

ns

tra
• Generate SSH keys

n-
• Create a Virtual Cloud Network and its components

no
• Create a compute instance

. sa
• Install an Apache HTTP server on the instance

ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh

Prerequisites
om
ind

• You have access to the OCI Console.


Ar

Assumptions
• In this lab, we are considering US East (Ashburn, Region Key – IAD) as your region.
• You must be familiar with navigating the OCI Console.

Copyright © 2023, Oracle and/or its affiliates.

38 Create a Web Server on a Compute Instance


Launch Cloud Shell
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

The OCI Cloud Shell is a web browser–based terminal accessible from the OCI Console. It
provides access to a Linux shell, with a pre-authenticated OCI CLI.

In this practice, you will access Cloud Shell via the OCI Console.

le
Tasks

b
ra
fe
1. Sign in to your Oracle Cloud Infrastructure Console.

ns
tra
2. In the Console ribbon at the top of the screen, click the Region icon to expand the menu.

n-
Ensure that you are in the correct region, US East (Ashburn).

no
3. Click the Cloud Shell icon next to the Region in the Console ribbon.

. sa
ide ha
Note: The OCI CLI running in the Cloud Shell will execute commands against the region
selected in the Console's region selection menu when the Cloud Shell is started.

Gu )
is om
This displays the Cloud Shell in a "drawer" at the bottom of the console.
th .c
e ail

You can use the icons in the top-right corner of the Cloud Shell window to minimize,
us m

4.
to @g

maximize, and close your Cloud Shell session.


se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create a Web Server on a Compute Instance 39


Generate SSH Keys
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will generate SSH keys using Cloud Shell.

Tasks

1. From the OCI Console, click the Cloud Shell icon next to the region in the Console ribbon.

ble
ra
2. After the Cloud Shell has started, run the following commands:

fe
ns
$ mkdir .ssh

tra
Important: In case you get an error that says “cannot create director: File exists”, you can

n-
skip running the first command.

no
. sa
$ cd .ssh

ide ha
$ ssh-keygen -b 2048 -t rsa –f <<sshkeyname>>

Gu )
is om
Replace <<sshkeyname>> with ocifalab4key. Select the key name you can remember.
th .c
This will be the key name you will use to connect to the compute instance you create.
e ail
us m

Note: If you receive an error message for the above command, enter the command
to @g

manually.
se sh

Remember:
en ho
lic mg

▪ After entering the third command, press Enter twice for no passphrase.
do

▪ Do not include the angle brackets «» and $ symbol when pasting code into Cloud
rin

Shell.
(a
h

3. Examine the two files that you just created by running the following command:
os
Gh

$ ls
om

Note: In the output, there are two files, a private key <<sshkeyname>> and a public
ind

key <<sshkeyname>>.pub. Keep the private key safe and don’t share its contents with
anyone. The public key will be needed for various activities and can be uploaded to certain
Ar

systems as well as copied and pasted to facilitate secure communications in the cloud.

Copyright © 2023, Oracle and/or its affiliates.

40 Create a Web Server on a Compute Instance


4. To list the contents of the public key, run the following command:
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

$ cat <<sshkeyname>>.pub

Replace <<sshkeyname>> with ocifalab4key.

Note: The angle brackets «» should not appear in your code.

le
Copy the contents of the public key as you will require this in a subsequent step. Make

b
5.

ra
sure that you remove any hard returns that may have been added when copying.

fe
The .pub key should be one line.

ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create a Web Server on a Compute Instance 41


Create a Virtual Cloud Network and Its Components
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will create a Virtual Cloud Network (VCN), subnet, and Internet gateway
and add route rules in the route table.

Tasks

ble
1. From the Main Menu, under Networking, click Virtual Cloud Networks.

ra
fe
2. Click Create VCN.

ns
tra
3. In the Create a Virtual Cloud Network dialog box, populate the following information:

n-
no
a. Name: IAD-FA-LAB04-1-VCN-01

. sa
b. Create in Compartment: <your compartment>

ide ha
c. IPv4 CIDR Blocks: 10.0.0.0/16 (Press Enter to add.)

Gu )
is om
4. Keep the other options default and click Create VCN.
th .c
e ail

You can see that the VCN is created successfully.


us m
to @g

5. Click IAD-FA-LAB04-1-VCN-01 VCN to view the details page.


se sh

Click Create Subnet.


en ho

6.
lic mg

7. In the Create Subnet dialog box, populate the following information:


do

Name: IAD-FA-LAB04-1-SNET-01
rin

a.
(a

b. Create in Compartment: <your compartment>


h
os

c. Subnet Type: Regional


Gh

d. IPv4 CIDR Blocks: 10.0.1.0/24


om
ind

e. Subnet Access: Public Subnet


Ar

8. Keep the other options default and click Create Subnet.

You can see that the subnet is created successfully, and the state is Available.

9. Under Resources in the left navigation panel, click Internet Gateways.

Copyright © 2023, Oracle and/or its affiliates.

42 Create a Web Server on a Compute Instance


10. Click Create Internet Gateway.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

11. In the Create Internet Gateway dialog box, populate the following information:

a. Name: IAD-FA-LAB04-1-IG-01

b. Create In Compartment: <your compartment>

leb
12. Click Create Internet Gateway.

ra
fe
You can see that the Internet gateway is created successfully and the state is Available.

ns
tra
13. Under Resources in the left navigation panel, click Route Tables.

n-
no
14. Click Default Route Table for IAD-FA-LAB04-1-VCN-01.

. sa
15. Click Add Route Rules.

ide ha
16. In the Add Route Rules dialog box, populate the following information:

Gu )
is om
a. Target Type: Internet Gateway
th .c
e ail

Destination CIDR Block: 0.0.0.0/0


us m

b.
to @g

c. Target Internet Gateway: IAD-FA-LAB04-1-IG-01


se sh

17. Click Add Route Rules.


en ho
lic mg

You can see that the route rule is successfully added in the default Route Table.
do

18. Navigate back to the Virtual Cloud Networks page from the Main Menu.
rin
(a

19. Click IAD-FA-LAB04-1-VCN-01 VCN to view the details page.


h
os

20. Under Resources in the left navigation panel, click Security Lists.
Gh

21. Click Default Security List for IAD-FA-LAB04-1-VCN-01.


om
ind

22. Here, you need to open port 80. Click Add Ingress Rules.
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create a Web Server on a Compute Instance 43


23. In the Add Ingress Rules dialog box, populate the following information:
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

a. Source Type: CIDR

b. Source CIDR: 0.0.0.0/0

c. IP Protocol: TCP

ble
d. Destination Port Range: 80

ra
fe
Note: Do not select the Stateless check box. The Source Port Range field is set to All by

ns
default.

tra
n-
24. Click Add Ingress Rule.

no
You can see that the route rule is successfully added.

. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

44 Create a Web Server on a Compute Instance


Create a Compute Instance
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will launch a compute instance and connect to it.

Tasks

1. From the OCI Console Main Menu, under Compute, click Instances.

leb
ra
2. Click Create instance.

fe
ns
3. In the Create compute instance dialog box, populate the following information:

tra
Name: IAD-FA-LAB04-1-VM-01

n-
a.

no
b. Create in compartment: <your compartment>

. sa
Placement (Availability domain): AD 1

ide ha
c.

Gu )
Click Show advanced options and select On-demand capacity under Capacity type.
is om
th .c
d. Image: Oracle Linux 8
e ail
us m

e. Shape: Click Change Shape and select the following:


to @g

Instance Type: Virtual Machine


se sh

1)
en ho

2) Shape Series: Ampere


lic mg

Shape Name: VM.Standard.A1.Flex


do

3)
rin

4) Leave Number of OCPU at one.


(a
h

5) Leave Amount of memory (GB) at six.


os
Gh

6) Click Select Shape.


om

f. Primary network: Select an existing Virtual Cloud Network.


ind

1) Virtual cloud network in <your compartment>: IAD-FA-LAB04-1-VCN-01


Ar

2) Subnet: Select an existing subnet.

3) Subnet in <your compartment>: IAD-FA-LAB04-1-SNET-01 (regional)

4) Public IP address: Assign a public IPv4 address.

Copyright © 2023, Oracle and/or its affiliates.

Create a Web Server on a Compute Instance 45


g. Add SSH keys: Paste public keys.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

h. SSH Keys: <public key> (Paste the public key which you copied in Step 5 of Generate
SSH Keys practice.)

Note: Keep the default option for Boot volume.

le
4. Click Create.

b
ra
You will see that the instance is created successfully, and the state is Running.

fe
ns
5. Copy the public IP corresponding to the IAD-FA-LAB04-1-VM-01 instance and paste it in

tra
the Notepad.

n-
no
6. Click the Cloud Shell icon next to Region at the top of the screen.

. sa
7. Run the following command using SSH to connect to your instance:

ide ha
$ ssh -i <private_key_file> <username>@<public-ip-address>

Gu )
is om
The /home/username/.ssh/private_key_file is the full path and name of the
th .c
a.
e ail

file that contains the private key associated with the instance you want to access.
us m
to @g

b. The <username> is the default user opc.


se sh

c. The <public-ip-address> is the public IP address of the instance.


en ho
lic mg

Note: Enter yes in response to “Are you sure you want to continue connecting (yes/no)?”
do

You are now connected to the instance IAD-FA-LAB04-1-VM-01.


rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

46 Create a Web Server on a Compute Instance


Install an Apache HTTP Server on the Instance
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

The HTTP server is an open-source web server developed by the Apache Software
Foundation. The Apache server hosts web content and responds to requests for this content
from web browsers such as Chrome or Firefox.

In this practice, you will install an Apache HTTP web server and connect to it over the public

leb
Internet.

ra
fe
Tasks

ns
tra
1. On the OCI Console, click the Cloud Shell icon at the top of the screen.

n-
no
2. While connected to your compute instance via SSH, run the following commands:

. sa
a. Install Apache HTTP:

ide ha
$ sudo yum install httpd -y

Gu )
is om
b. Start the Apache server and configure it to start after system:
th .c
e ail

$ sudo apachectl start


us m
to @g

$ sudo systemctl enable httpd


se sh

c. Run a quick check on Apache configurations:


en ho
lic mg

$ sudo apachectl configtest


do

d. Create firewall rules to allow access to the ports on which the HTTP server listens:
rin
(a

$ sudo firewall-cmd --permanent --zone=public --add-


service=http
h
os

$ sudo firewall-cmd --reload


Gh
om

e. Create an index file for your web server.


ind

$ sudo bash -c 'echo This is my Web-Server running on Oracle


Cloud Infrastructure >> /var/www/html/index.html'
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create a Web Server on a Compute Instance 47


3. Open your browser and enter http://Public-IPAddress in the address bar (the IP
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

address of the compute instance).

You should see the index page of the web server we created in the second step (last point).

This is my Web-Server running on Oracle Cloud Infrastructure

ble
ra
fe
ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

48 Create a Web Server on a Compute Instance


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
ide ha
Lab 5-1 Practices

. sa
no
n-
tra
ns
fe
ra
b le
Object Storage: Create and
Manage OCI Object Storage
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

The Oracle Cloud Infrastructure (OCI) Object Storage provides unlimited capacity with high
durability and scalability. It is highly reliable and cost efficient. The object storage resources

le
include namespace, bucket, and object.

b
ra
Object Storage is characterized by strong consistency and security with encryption. By

fe
creating unlimited buckets, you can add as many objects as required with a maximum of 10TiB

ns
per object. In this lab, you will work on buckets, object versioning, object life cycle

tra
management, replication policy, and retention rule.

n-
no
In this lab, you will:

. sa
• Create an Object Storage bucket

ide ha
• Upload an object to a bucket

Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om

Prerequisites
ind

• You have access to the OCI Console.


Ar

Assumptions
• In this lab, we are considering US East (Ashburn, Region Key – IAD) as your region.
• You must be familiar with navigating the OCI Console.

Copyright © 2023, Oracle and/or its affiliates.

50 Create and Manage OCI Object Storage


Create an Object Storage Bucket
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will create an Object Storage bucket.

Tasks

1. Sign in to your OCI account.

leb
ra
2. From the Main Menu, select Storage.

fe
ns
3. Under Object Storage and Archive Storage, click Buckets.

tra
From the left navigation panel, select the compartment in which you have permission to

n-
4.

no
work. Then the page updates to display only the resources in that compartment.

. sa
5. Click Create Bucket.

ide ha
6. In the Create Bucket dialog box, specify the following attributes of the bucket:

Gu )
is om
▪ Bucket Name: Enter IAD-FA-LAB05-1-BKT-01-xxx as the name for the bucket.
th .c
Specify a random number in place of xxx to make it unique.
e ail
us m

▪ Default Storage Tier: Select the default tier in which you want to store the data. After
to @g

it is set, you cannot change the default storage tier of a bucket. When you upload
se sh

objects, this tier will be selected by default. You can, however, select a different tier. In
en ho

this case, select Standard, which is the primary and default storage tier used for Object
lic mg

Storage.
do

▪ Enable Auto-Tiering: Auto-Tiering helps you automatically move objects between


rin

Standard and Infrequent Access tiers based on their access patterns. Do not enable this
(a

field now.
h
os

▪ Enable Object Versioning: Versioning directs Object Storage to automatically create


Gh

an object version each time a new object is uploaded, an existing object is overwritten,
om

or when an object is deleted. You can enable it while creating a bucket or later. Do not
enable this field now.
ind
Ar

▪ Emit Object Events: Emit Object Events lets the bucket emit events for object state
changes. Do not select this field now.

▪ Uncommitted Multipart Uploads Cleanup: Uncommitted Multipart Uploads Cleanup


allows deletion of uncommitted or failed multipart uploads. Do not select this field now.

Copyright © 2023, Oracle and/or its affiliates.

Create and Manage OCI Object Storage 51


▪ Encryption: Buckets are encrypted with keys managed by Oracle by default, but you
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

can optionally encrypt the data in this bucket using your own vault encryption key.
Select the Encrypt using Oracle managed keys option.

▪ Tags: If you have permissions to create a resource, then you also have permissions to
apply free-form tags to that resource. Skip this option. You can always apply tags later.

le
7. Click Create.

b
ra
The bucket is created immediately, and you can add objects to it.

fe
ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

52 Create and Manage OCI Object Storage


Upload an Object to a Bucket
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will upload an object to your bucket. Object Storage supports uploading
individual files up to 10 TiB.

Before you upload an object to a bucket, you must have a bucket. In this case, you will use the
bucket that is created from the previous practice.

leb
ra
Tasks

fe
ns
1. In the Main Menu, navigate to Storage, and then select Buckets.

tra
n-
2. Click the bucket IAD-FA-LAB05-1-BKT-01-xxx to view its details.

no
3. Under Objects, click Upload.

. sa
ide ha
4. In the Object Name Prefix field, enter the file name prefix oci/ for the files you plan to
upload. This step is optional.

Gu )
is om
The Storage Tier field is populated as Standard. You can optionally change the storage
th .c
5.
e ail

tier (to Infrequent Access or Archive) to upload objects. In this case, keep it as Standard.
us m
to @g

6. Select the objects to upload (browse any object from your local machine) by using one of
the following options:
se sh
en ho

▪ Drag files from your computer into the Drop files here... section.
lic mg

▪ Click the Select Files link to display a file selection dialog box.
do
rin

As you select files to upload, they are displayed in a scrolling list. If you decide that you
(a

do not want to upload a file that you have selected, click X to the right of the file name.
h
os

If selected files to upload and files already stored in the bucket have the same name,
Gh

warning messages to overwrite are displayed.


om

7. Click Upload.
ind

The selected objects are uploaded. Click Close to return to the bucket.
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create and Manage OCI Object Storage 53


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

54
Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )

Copyright © 2023, Oracle and/or its affiliates.


ide ha
. sa
no
n-
tra
ns
fe
ra
b le

Create and Manage OCI Object Storage


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
ide ha
Lab 6-1 Practices

. sa
no
n-
tra
ns
fe
ra
b
Attach a Block Volume

le
Block Storage: Create, and
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

The Oracle Cloud Infrastructure (OCI) Block Volume service lets you dynamically provision and
manage block storage volumes. You can create, attach, connect, and move volumes, as well as

le
change volume performance, as needed, to meet your storage, performance, and application

b
requirements.

ra
fe
In this lab, you will:

ns
tra
a. Create a Virtual Cloud Network and its components

n-
no
b. Create a VM instance

. sa
c. Create a block volume

ide ha
Attach a block volume to a compute instance

Gu )
d.
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Prerequisites
• You have access to the OCI Console.

Copyright © 2023, Oracle and/or its affiliates.

56 Create, Attach, Detach, and Resize a Block Volume


Assumptions
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

• In this lab, we are considering US East (Ashburn, Region Key – IAD) as your region.
• You must be familiar with navigating the OCI Console.

leb
ra
fe
ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create, Attach, Detach, and Resize a Block Volume 57


Create a Virtual Cloud Network and Its Components
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will learn how to create a Virtual Cloud Network (VCN), subnet, and
Internet gateway, and add route rules in the Route Table.

Tasks

b le
1. Sign in to the OCI Console.

ra
fe
2. In the Console ribbon at the top of the screen, click the Region icon to expand the menu.

ns
Ensure that you are in the correct region, US East (Ashburn).

tra
n-
3. From the Main Menu, select Networking, and then click Virtual Cloud Networks.

no
4. Click Create VCN.

. sa
Enter the following:

ide ha
5.

Gu )
Name: Enter IAD-FA-LAB06-1-VCN-01.
a.
is om
th .c
b. Create in Compartment: Select the <compartment name> assigned to you.
e ail
us m

c. IPv4 CIDR Blocks: Type 10.0.0.0/16 and press Enter.


to @g

Note: You can leave all the other options as default.


se sh
en ho

6. Click Create VCN. The VCN is now created successfully.


lic mg

7. Click Create Subnet.


do
rin

8. In the Create Subnet dialog box, do the following:


(a

a. Name: Enter IAD-FA-LAB06-1-SNET-01.


h
os

b. Create in Compartment: Select the <compartment name> assigned to you.


Gh

Subnet Type: Select Regional.


om

c.
ind

d. IPv4 CIDR Blocks: Enter 10.0.1.0/24.


Ar

e. Subnet Access: Select Public Subnet.

Note: You can leave all the other options as default.

9. Click Create Subnet. The subnet is now created successfully, and the state is Available.

Copyright © 2023, Oracle and/or its affiliates.

58 Create, Attach, Detach, and Resize a Block Volume


10. In the left navigation pane, under Resources, click Internet Gateways.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

11. Click Create Internet Gateway.

12. Do the following:

a. Name: Enter IAD-FA-LAB06-1-IG-01.

leb
b. Create in Compartment: Select the <compartment name> assigned to you.

ra
fe
13. Click Create Internet Gateway. The Internet gateway is now created successfully, and the

ns
state is Available.

tra
n-
14. In the left navigation pane, under Resources, click Route Tables.

no
15. Click Default Route Table for IAD-FA-LAB06-1-VCN-01.

. sa
ide ha
16. Click Add Route Rules and do the following:

Gu )
a. is om
Target Type: Select Internet Gateway from the drop-down list.
th .c
Destination CIDR Block: Enter 0.0.0.0/0.
e ail

b.
us m

Target Internet Gateway: Select IAD-FA-LAB06-1-IG-01 from the drop-down list.


to @g

c.
se sh

17. Click Add Route Rules. The route rule is now successfully added to the default Route
en ho

Table.
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create, Attach, Detach, and Resize a Block Volume 59


Create a VM Instance
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

In this practice, you will learn how to create SSH keys using Cloud Shell and how to launch an
instance.

Tasks

b le
1. Sign in to the OCI Console.

ra
fe
2. In the Console ribbon at the top of the screen, click the Regions icon to expand the menu.

ns
Ensure that you are in the correct region, US East (Ashburn).

tra
n-
3. In the Console ribbon at the top of the screen, click the Cloud Shell icon next to the

no
Region selection menu.

. sa
4. Once the Cloud Shell is ready, enter the following commands:

ide ha
$ mkdir .ssh

Gu )
is om
▪ Important: In case you get an error “Cannot create directory: File exists,” you can skip
th .c

running this first command.


e ail
us m

$ cd .ssh
to @g
se sh

$ ssh-keygen -b 2048 -t rsa –f <<sshkeyname>>


en ho

▪ Remember: After entering this third command, press Enter twice for no passphrase.
lic mg

Note: Replace <<sshkeyname>> with ocifalab6key. Choose a key name you can
do

remember. This will be the key name you will use to connect to the compute instance you
rin

create.
(a
h

Reminder: The angle brackets «» should not appear in your code.


os
Gh

Reminder: Do not include the $ symbol when pasting code into Cloud Shell.
om

5. Examine the two files that you just created by running the following command:
ind

$ ls
Ar

Note: In the output, there are two files, a private key <<sshkeyname>> and a public
key <<sshkeyname>>.pub. Keep the private key safe and don’t share its contents with
anyone. The public key will be needed for various activities and can be uploaded to certain
systems, as well as copied and pasted to facilitate secure communications in the cloud.

Copyright © 2023, Oracle and/or its affiliates.

60 Create, Attach, Detach, and Resize a Block Volume


6. To list the contents of the public key, use the following command:
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

$ cat <<sshkeyname>>.pub

Note: Replace <<sshkeyname>> with ocifalab6key.

Reminder: The angle brackets «» should not appear in your code.

le
Copy the contents of the public key as you will need this in a subsequent step. Make sure

b
7.

ra
that you remove any hard returns that may have been added when copying. The .pub

fe
key should be one line.

ns
tra
8. From the Main Menu, select Compute. Under Compute, click Instances.

n-
no
9. Click Create instance and do the following:

. sa
a. Name: Enter IAD-FA-LAB06-1-VM-01.

ide ha
Create in compartment: Select the <compartment name> assigned to you.

Gu )
b.
is om
Placement: Select Availability Domain AD1. Click Show advanced options and select
th .c
c.
e ail

On-demand capacity from the Capacity type menu.


us m
to @g

d. Image: Select Oracle Linux 8.


se sh

e. Shape: Click Change Shape and select the following:


en ho
lic mg

1) Instance Type: Virtual Machine


do

2) Shape Series: Ampere


rin
(a

3) Shape Name: VM.Standard.A1.Flex


h
os

4) Leave Number of OCPU at one.


Gh

5) Leave Amount of memory (GB) at six.


om

6) Click Select Shape.


ind
Ar

f. Networking: Select the existing VCN IAD-FA-LAB06-1-VCN-01 and existing subnet


IAD-FA-LAB06-1-SNET-01 (regional). Under Public IP address, select Assign a
public IPv4 address.

g. Add SSH keys: Select Paste public keys and paste the contents of the public key,
which you copied in Step 6, in the box.

Copyright © 2023, Oracle and/or its affiliates.

Create, Attach, Detach, and Resize a Block Volume 61


h. Boot volume: Keep the default selection.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

10. Click Create.

Note: After a couple of minutes, you see that the instance is successfully created, and the
state is Running.

11. Under Instance access, copy the Public IP address.

b le
ra
12. Click the Cloud Shell icon to open Cloud Shell, and use SSH to connect to your instance

fe
by using the following command:

ns
tra
Note: Enter yes in response to “Are you sure you want to continue connecting (yes/no)?”

n-
$ ssh -i <private_key_file> <username>@<public-ip-address>

no
. sa
Reminders:

ide ha
▪ /home/username/.ssh/private_key_file is the full path and name of the file

Gu )
is om
that contains the private key associated with the instance you want to access.
th .c
▪ <username> is the default user opc.
e ail
us m

▪ <public-ip-address> is the public IP address of the instance.


to @g

13. You are now connected to the instance IAD-FA-LAB06-1-VM-01. Run the following
se sh

command to display information about the block devices:


en ho
lic mg

$ lsblk
do

Note: You will only see the boot disk sda.


rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

62 Create, Attach, Detach, and Resize a Block Volume


Create a Block Volume
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

The OCI Block Volume service lets you dynamically provision and manage block storage
volumes.

In this practice, you will learn how to create a block volume.

le
Tasks

b
ra
fe
1. Sign in to the OCI Console.

ns
tra
2. Open the Main Menu and click Storage. Under Block Storage, click Block Volumes.

n-
3. Click Create Block Volume.

no
4. Fill in the required volume information:

. sa
ide ha
a. Name: Enter IAD-FA-LAB06-1-BV-01.

Gu )
is om
b. Create in Compartment: Select the <compartment name> assigned to you.
th .c
c. Availability Domain: Select the first availability domain.
e ail
us m

d. Volume Size and Performance: Select Custom and specify the following:
to @g
se sh

1) Volume Size (in GB): Enter 50.


en ho

2) Target Volume Performance: Drag the VPUs/GB slider to the left to make the
lic mg

performance Lower Cost.


do
rin

e. Backup Policies: Do not specify any policy.


(a

f. Cross Region Replication: Keep the OFF default selection.


h
os

g. Encryption: Keep the default Encrypt using Oracle-managed keys selection.


Gh

5. Click Create Block Volume. You now see that the Block Volume state becomes Available.
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Create, Attach, Detach, and Resize a Block Volume 63


Attach a Block Volume to a Compute Instance
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

You can create, attach, connect, and move volumes. You can also change volume
performance, as needed, to meet your storage, performance, and application requirements.
After you attach and connect a volume to an instance, you can use the volume like a regular
hard drive.

b le
In this practice, you’ll learn how to attach a block volume to a compute instance and perform

ra
various configuration tasks on the attached volume.

fe
ns
Tasks

tra
n-
1. Open the Main Menu and click Compute. Under Compute, click Instances.

no
In the Instances list, click the instance IAD-FA-LAB06-1-VM-01.

. sa
2.

ide ha
3. In the left navigation pane, under Resources, click Attached block volumes.

Gu )
4. Click Attach block volume. is om
th .c
e ail

5. Specify the volume you want to attach to. For example, to use the volume name,
us m

choose Select volume, and then select the volume IAD-FA-LAB06-1-BV-01 from
to @g

the Volume drop-down list.


se sh

6. If the instance supports consistent device paths, and the volume you are attaching is not a
en ho

boot volume, select the path /dev/oracleoci/oraclevdb from the Device path drop-
lic mg

down list. This enables you to specify a device path for the volume attachment that
do

remains consistent between instance reboots.


rin

In the Attachment type section, select Paravirtualized.


(a

7.
h

Note: After you attach a volume using the Paravirtualized attachment type, it is ready to
os

use, and you do not need to run any additional commands.


Gh
om

8. In the Access section, select Read/Write.


ind

Note: This is the default option for volume attachments and, with this option, an instance
Ar

can read and write data to the volume.

9. Click Attach. You now see the state as Attached and, since the attachment type
is Paravirtualized, you can use the volume without running any additional commands.

Copyright © 2023, Oracle and/or its affiliates.

64 Create, Attach, Detach, and Resize a Block Volume


10. Ensure that you are connected to the instance IAD-FA-LAB06-1-VM-01.
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Note: For help with this, refer to Step 11 in the Create a VM Instance practice.

11. Run the following command to display information about the block devices:

$ lsblk

le
Note: You now see that the system recognizes a new disk device, and the size is 50 GB.

b
ra
fe
12. To verify that the volume is attached to the instance, run the following command:

ns
tra
$ ll /dev/oracleoci/oraclevd*

n-
13. To partition the disk using fdisk, run the following command:

no
. sa
$ sudo fdisk /dev/oracleoci/oraclevdb

ide ha
Note: Enter the following responses as seen in Cloud Shell:

Gu )
a.
is om
Command (m for help): Enter n to create a new partition.
th .c
e ail

b. Select (default p): Enter p.


us m
to @g

c. Partition number (1,4, default 1): Press Enter.


se sh

d. First sector: Press Enter.


en ho
lic mg

e. Last sector: Press Enter.


do

f. Command (m for help): Enter w to write the new partition.


rin
(a

14. To format the partition, run the following command:


h
os

$ sudo mkfs -t ext4 /dev/oracleoci/oraclevdb1


Gh

15. To mount the partition, run the following commands:


om

$ sudo mkdir -p /mnt/volume1


ind
Ar

$ sudo mount /dev/oracleoci/oraclevdb1 /mnt/volume1

Note: On Linux instances, if you want to automatically mount volumes on an instance


boot, you need to set some specific options in the /etc/fstab file.

Copyright © 2023, Oracle and/or its affiliates.

Create, Attach, Detach, and Resize a Block Volume 65


16. To display information about the block devices, run the following command:
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

$ lsblk

Note: You now see the partition and the mountpoint /mnt/volume1.

b le
ra
fe
ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

66 Create, Attach, Detach, and Resize a Block Volume


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )
ide ha
Lab 7-1 Practices
. sa
no
Security Zones

n-
tra
ns
fe
ra
b
Zones Using Maximum

le
Security: Configure Security
Get Started
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Overview

Security zones enforce security posture on OCI cloud compartments and prevent actions that
can compromise a customer’s security posture. Security zone policies can be applied to

le
various cloud infrastructure types (network, compute, storage, database, and so on) to

b
guarantee cloud resources ensure security and to prevent potential misconfigurations.

ra
fe
In this lab, you will:

ns
tra
a. Set up a security zone with Maximum Security Recipe

n-
no
b. View the security zone policies attached to a created security zone

. sa
c. Test creating a bucket in an assigned compartment using an Oracle-managed key

ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

68 Configure Security Zones using Maximum Security Zones


Prerequisites
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

• You have access to the OCI Console.


• Your tenancy should have Cloud Guard enabled.

Assumptions

leb
ra
• In this lab, we are considering US East (Ashburn) (IAD) as your region.

fe
• You must be familiar with navigating the OCI Console.

ns
tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Configure Security Zones using Maximum Security Zones 69


Set Up Security Zone with Maximum Security Recipe
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

You will create a security zone for an allocated compartment and check for any security zone
policy violations.

Tasks

b le
1. Sign in to the OCI Console.

ra
fe
2. In the Console ribbon at the top of the screen, click the Region icon to expand the menu.

ns
Ensure that you are in the correct region, US East (Ashburn).

tra
n-
3. From the navigation menu, select Identity & Security. Navigate to Security Zones, and

no
then click Overview.

. sa
4. In the left navigation pane, under Scope, select <your assigned compartment> from the

ide ha
drop-down menu.

Gu )
is om
Note: The compartment should not be associated with a security zone. By default, all sub-
th .c
compartments are also in the same security zone.
e ail
us m

5. Click Create Security Zone.


to @g

6. On the Create Security Zone page, enter the following values:


se sh
en ho

a. Security Zone Recipe: Select Oracle-managed to use Maximum Security Recipe.


lic mg

b. Name: IAD-FA-LAB07-1-SZ-01
do
rin

c. Description: My Security Zone


(a

Create for compartment: <your assigned compartment>


h

d.
os
Gh

7. Click Create Security Zone.


om

Note: When you create a security zone for a compartment, Cloud Guard does the
following:
ind

• Deletes any existing Cloud Guard target for the compartment and for any child
Ar

compartments
• Creates a security zone target for the compartment
• Adds the default Oracle-managed detector recipes to the security zone target

Copyright © 2023, Oracle and/or its affiliates.

70 Configure Security Zones using Maximum Security Zones


View the Security Zone Policies Attached with a Created
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Security Zone
You will identify the recipe associated with the newly formed security zone, and then review its
policies.

le
1. From the navigation menu, select Identity & Security. Navigate to Security Zones, and

b
then click Overview.

ra
fe
In the left navigation pane, under Scope, select <your assigned compartment> from the

ns
2.
drop-down menu.

tra
n-
3. Click the IAD-FA-LAB07-1-SZ-01 security zone and view the Security Zone details page.

no
On the Security Zone information tab, locate the attached recipe and click the Recipe for

. sa
4.
this security zone: Maximum Security Recipe – 20200914.

ide ha
Gu )
5. View the Oracle-managed recipe attached to the Security Zone created on the Recipe
details page.
is om
th .c
e ail

6. View a few policy statements with associated Resource types:


us m

deny public_subnets in VIRTUALNETWORK


to @g

deny public_buckets in OBJECTSTORAGE


se sh

deny buckets_without_vault_key in in OBJECTSTORAGE


en ho

Next, you will put a security zone to test by attempting to violate a few of its policies.
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Configure Security Zones using Maximum Security Zones 71


Verify Creating a Bucket in an Assigned Compartment
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

Using a Oracle-Managed Key


You will test the security zone. Create a bucket to check if it is restricted in the security zone.
As a reference, the security zone recipe has a policy that prohibits bucket creation without a
customer-managed vault key.

b le
To create a bucket to observe the security zone violations:

ra
fe
Open the navigation menu and click Storage. Navigate Object Storage, click Buckets.

ns
1.

tra
2. In the left navigation pane, under List Scope, select the assigned compartment from the

n-
drop-down menu.

no
Click Create Bucket.

. sa
3.

ide ha
4. In the Create Bucket dialog box, specify the attributes of the bucket:

Gu )
a. is om
Bucket Name: IAD-FA-LAB07-1-BKT-01-<user-id>
th .c
Please specify your user ID in place of <user-id> to make it unique.
e ail
us m

b. Default Storage Tier: Standard


to @g

Encryption: Encrypt using Oracle-managed keys.


se sh

c.
en ho

Note: Leave all the other options in their default setting.


lic mg

Click Create.
do

5.
rin

You will receive an error indicating a security zone violation: “Encrypt the bucket with a
(a

customer-managed encryption key”.


h
os

6. Click Cancel.
Gh

The security zone recipe created earlier has a policy that prohibits bucket creation without a
om

customer-managed key. You will need to create an OCI Vault and a master encryption key,
ind

using which you can create a bucket. This way the security zone recipes enforce security
posture on OCI cloud compartments and prevent actions that could compromise the security
Ar

posture of a customer.

Note: Please purge the Security Zone created for this lab.

Copyright © 2023, Oracle and/or its affiliates.

72 Configure Security Zones using Maximum Security Zones


Purge Security Zone
Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

1. From the navigation menu, select Identity & Security. Navigate to Security Zones and
click Overview.

2. Make sure you are in your given compartment.

le
3. From the list of Security Zones, locate your Security Zone and click its name: IAD-FA-

b
ra
LAB07-1-SZ-01.

fe
ns
4. Click Delete. Then click Delete in the Confirmation window.

tra
n-
no
. sa
ide ha
Gu )
is om
th .c
e ail
us m
to @g
se sh
en ho
lic mg
do
rin
(a
h
os
Gh
om
ind
Ar

Copyright © 2023, Oracle and/or its affiliates.

Configure Security Zones using Maximum Security Zones 73


Unauthorized reproduction or distribution prohibited. Copyright© 2023, Oracle University and/or its affiliates.

74
Ar
ind
om
Gh
os
h
(a
rin
do
lic mg
en ho
se sh
to @g
us m
e ail
th .c
is om
Gu )

Copyright © 2023, Oracle and/or its affiliates.


ide ha
. sa
no
n-
tra
ns
fe
ra
b le

Configure Security Zones using Maximum Security Zones

You might also like