Tech Fundamentals Flashcards
YAML (YAML ain’t markup language)
It’s a language for definning data or configuration, which is designed to be human readable.
- Is one of the languages which CloudFormation uses for its templates
YAML Document is an unordered collection of key-value pairs separated by a colon, each key has a value
key: value »_space;»»»> cat1: roffle (keys and values are strings)
YAML also supports number (1 or 2…), floating point (1.337), boolean (true or false), and null
YAML Introduction - List
YAML supports orther types and one of those are lists known as Arrays.
A list is an ordered set of values, and in YAML we can represent a list by having a key, in this care “adrianscats” and then as a value we might have something that looks like this:
adriancats: [“roffle”, “truffles”, “penny”, “winkie”] = a comma separated a set of values inside square brackets (this is known as inline format, where the list is placed where you expect the value to be after the key and the colon)
Also can be represented like this:
adrianscats:
- “roffle”
- “truffles”
- “penny”
- “winkie”
Indentation matters in YAML, it shows “roffle”, “truffles”, “penny” and “winkie” are part of the value for adrianscats
The “-“ means each item is a member of a list, same indentation = same list.
YAML Introduction - Structure
A dictionary is just a data structure, it’s a collection of one or more key value pairs, which are unordered.
adrianscats:
- name: roffle
color: [black, white]
- name: truffles
color: “mixed”
numbereyes: 1
Using YAML - key:value pairs, Lists and Dictionaries allows you to build complex data structures in a way which is human readable
JavaScript Object Notation (JSON)
Is a lightweight data-interchange format. It’s easy for humans to read and write. It’s easy for machines to parse and generate.
Is an alternative format, In AWS is only used for CloudFormation and other things such as policy documents, which are used within AWS for permissions.
JSON doesn’t care about indentation because everything is enclosed in some things, braces or brackets.
There are two main elements that you need to understand if you want to be competent with JSON:
- Object = Unordered set of key:value pairs enclosed by { & }:
{“roffle: “cat”, “sparky”: “dog”}
YAML dictionary = JSON object
-Array = Ordered collection of values, separated by commas & Enclosed in [ & ]:
[ “cat”, “cat”, “chicken”, “cat”]
YAML list = JSON Array
Values = string, object, number, array, true, false, null
Encryption Approaches
- Encryption at Rest = Is designed to protect against physical theft and physical tampering (One entity involved)
- Encryption in Transit = Aimed at protecting data while it’s being transferred between two places (Multiple individuals or systems)
Encryption does not prove identity.
Encryption Concepts
- Plaintext = Is un-encrypted data, it can be text, documents, images or an application. Plaintext is data that you can load into an application and use, or you can load and inmediately read that data.
- Algorithm = Is a piece of code or a piece of maths which takes plain text and an encryption key, and it generates encrypted data. When an algorithm is being used, it needs the plain text and a key. (AES,DES)
- Key = Is technically a password. When an algorithm takes plain text and the key, the output that it generates is ciphertext.
- Ciphertext = Isn’t always text data, is just encrypted data
So the relationship between all these things is that encryption, it takes plain text, it uses an algorithm and a key, and it uses those things to create a ciphertext
Decryption is just the reverse, it takes ciphertext, it takes a key and it generates plaintext
Symmetric & Asymmetric
- Symmetric = keys are used as part of a symmetric encryption process. The same key is used for both the encryption and decryption processes. (great for local file encryption, not useful where the data needs to be transferred between two parties, because arranging the transit of the key is the problem)
- Asymmetric = The keys used in asymmetric encryption are themselfs asymmetric. These are formed of two parts, a public key and a private key (in order to transfer, both sides need both keys).
A public key can be used to generate ciphertext, which can ONLY be decrypted by the private key. (used where two or more parties are involved)
Signing & Steganography
- Signing = Person 1, uses his private key to sign a document and then sends it to Person2, after that, Person2 uses Person1’s public key to verify that the document was signed using its matching private key. (generally used for ID verification and certain log on systems)
- Steganography =The problem of encryption is that, if you use it, it’s obvious that you’ve used it. Steganography is a method of hiding something in something else, like a ciphertext in an image.
OSI 7-Layer Model
- Networking Stack = All 7 layers of the OSI model
- Media Layers = Layers 1-3
Dealing with how data is moved between point A and point B, and these could be in the same local network or on opposite sides of the planet.
- Host Layers = Layers 3-7
How the data is chopped up and reassembled for transport, and how it’s formatted so that it’s understandable by both sides of a network connection.
Layer 1 - Physical
- Physical shared medium
- Standards for transmitting onto the medium (voltage levels, timing, rates, distances, modulation and connectors.)
- Standards for receiving from the medium
- There are no individual device addresses
- All data is processed by all devices
- No media access control and no collision detection
If multiple things transmit on the same layer one physical medium, then collisions occur and render all of the information useless.
Layer 2 - Data Link
- Allows multiple devices to coexist
- Identify devices using MAC addresses for every device on a network (48 bits) (Globally unique)
- Uses Layer 1 to perform the physical communication
- Provides frames = are a format for sending information over a layer 2 network
- Provides control access (sharing)
- Collision detection = Checks for any carrier before it instructs Layer 1 to transmit (avoiding collisions) but if they both trasmit at the same time and a collision is detected, then a jam signal is sent by all of the devices which detect it and then a random back off occurs, after this the transmission is retried.
- Unicast communication (1 to 1)
- Broadcast communication (ALL)
- Switches undestand frames and MAC addresses. They maintain a MAC address table which starts off empty. As the switch receives frames on its ports, it learns which devices are connected and populates the mac address table.
-Each port on the switch has a separate collision domain
Encapsulation = process of taking some data, wrapping it in something else.
Layer 3 - Network
- Internet Protocol (IP), is a Layer-3 protocol which adds cross-network IP addressing and routing to move data between Local Area Networks without direct P2P links
- ARP - Find the MAC address, for this IP
- Routers move packets from SRC to DST accross different networks, they remove frame encapsulation and add new frame encapsulation at every hop. (encapsulation means that an IP packet is put inside an ethernet frame for that part of the journey, then when it needs to be moved into a new network, that particular frame is removed, a new one is added around the same packet and it’s moved onto the next local network)
- Route Tables - Multiple Routes
- Allows communication device to device over the internet
Layer 3 - Problems
- No ordering mechanism
- Different packets can experience different delays
- No method for channels of communications - packets have a source and destination IP but no method of splitting by ARP or CHANNEL
- No flow control, if the source transmit faster than the destination can receive it can saturate the destination causing packet loss
IP Addressing (v4)
Ip addressing is what identifies a device which uses layer 3 IP networking
They are formed by two different parts
* The network which states which IP network the IP address belongs to
* The host which represents hosts on that network
- The entire IP address is 32 bits in size, so four sets of eight bits, and each of these eight bits is known as an octet.
- Default Gateway is an IP address on the local network which packets are forwarded to generally if the intended destination is not a local IP address.
- Subnet Mask = Allows a host to determine if an IP address needs to communicate with is local or remote - which influences if it needs to use a gateway or can communicate locally.
Route Tables & Routes /// Address Resolution Protocol (ARP)
- Route Tables & Routes
A route table is a collection of routes, each row in the table will have a destination field and next to it will have a new hop or a target field. The router compares packet destination IP and route table for matching destinations. The more specific prefixes are preferred (0 lowest, 32 highest)
Routing as a process is where packets are forwarded or routed hop by hop across the internet from source to destination (route tables enables this)
- Address Resolution Protocol (ARP)
This protocol is used generally when you have a layer 3 packet and you want to encapsulate it inside a frame and then send that frame to a MAC address. ARP will give you the MAC address for a given IP address.