diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..a5df216f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,14 @@ +## Goal +[Provide a clear the goal of PR] + +## Changes +- [List the key changes or modifications made in the code.] +- [Highlight any significant refactoring or architectural decisions.] + +## Testing +[Provide clear instructions on how to test the changes locally.] + +### Checklist: +- [ ] Clear title and description +- [ ] Documentation/README updated if needed +- [ ] No secrets or large temporary files diff --git a/.github/workflows/lab3-ci.yml b/.github/workflows/lab3-ci.yml new file mode 100644 index 00000000..d591d23f --- /dev/null +++ b/.github/workflows/lab3-ci.yml @@ -0,0 +1,32 @@ +name: Lab 3 CI Pipeline + +on: + push: + workflow_dispatch: + +jobs: + explore-github-actions: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run a one-line script + run: echo "Hello, World! This job is running on a ${{ runner.os }} server powered by GitHub Actions!" + + - name: Debug Information + run: | + echo "This job is running on: ${{ runner.os }}" + echo "The GitHub Actor who triggered it is: ${{ github.actor }}" + echo "The GitHub SHA of the commit is: ${{ github.sha }}" + + - name: Gather System Information + run: | + echo "--- OS Information ---" + uname -a + echo "--- CPU Information ---" + lscpu + echo "--- Memory Information ---" + free -h + echo "--- Disk Usage ---" + df -h \ No newline at end of file diff --git a/labs/image-1.png b/labs/image-1.png new file mode 100644 index 00000000..4b4c708b Binary files /dev/null and b/labs/image-1.png differ diff --git a/labs/image-2.png b/labs/image-2.png new file mode 100644 index 00000000..f646b43c Binary files /dev/null and b/labs/image-2.png differ diff --git a/labs/image.png b/labs/image.png new file mode 100644 index 00000000..3f9bb38c Binary files /dev/null and b/labs/image.png differ diff --git a/labs/submission1.md b/labs/submission1.md new file mode 100644 index 00000000..73f6f550 --- /dev/null +++ b/labs/submission1.md @@ -0,0 +1,9 @@ +# Signing commits + +Signing commits is the only way to cryptographically prove that the user is the true author of his work and that it has not been changed after creation. + +# Benefits of signing commits + +- It is impossible to impersonate another developer +- Guarantees that the code in the commit has not been changed after its creation +- Signed commits show that the project can be trusted diff --git a/labs/submission2.md b/labs/submission2.md new file mode 100644 index 00000000..7f3df6fd --- /dev/null +++ b/labs/submission2.md @@ -0,0 +1,212 @@ +## Task 1 + +```bash +git cat-file -p 439bf53 # commit_hash +``` +Output +``` +tree dcaa1e94d50c159627af01884315276133a3d548 +parent d59bfed5ef4f292af5d591d6c1883333901b8e32 +author Aleliya 1757689894 +0300 +committer Aleliya 1757689894 +0300 +gpgsig -----BEGIN SSH SIGNATURE----- + + -----END SSH SIGNATURE----- + +Update test1 file +``` +--- + +```bash +git cat-file -p dcaa1e94d50c159627af01884315276133a3d548 # tree_hash +``` +Output +``` +040000 tree 6997d00fd149a3c2fee5d8b20c2b39ba815498f4 .github +100644 blob 4db373667a50f14a411bb5c7e879690fd08aacc1 README.md +040000 tree 61d4d824c8deb93779f2620042486ccda0cd241b labs +040000 tree 1865343f08695045014e0ed223b464e5403fca25 lectures +100644 blob c6a93f3dab646d08504b538a6ef9d44713fa030f test1.txt +``` +--- +```bash +git cat-file -p c6a93f3dab646d08504b538a6ef9d44713fa030f #blob_hash for test1.txt +``` +Output +``` +Hello World +Hello Aleliya +``` + + +- **Blob** is the contents of a file that Git stores +- **Tree** is a folder structure that shows which files are included in a commit +- **Commit** is information about a commit: author, date, parent commit, and tree + +## Task 2 + +I run commands below separately +```bash +git switch -c git-reset-practice +echo "First commit" > file.txt && git add file.txt && git commit -m "First commit" +echo "Second commit" >> file.txt && git add file.txt && git commit -m "Second commit" +echo "Third commit" >> file.txt && git add file.txt && git commit -m "Third commit" + +git reset --soft HEAD~1 # only move the pointer one commit back, but the files remain changed + +git reset --hard HEAD~1 # moves back a commit and deletes the changes + +git reflog # shows the history of all actions in the git + +git reset --hard 75c6e75 # restores the commit +``` + +After commits +```bash + git log --oneline +``` +output +``` +75c6e75 (HEAD -> git-reset-practice) Third commit +b512348 Second commit +60c05b2 First commit +``` +After all the commands above +```bash +git reflog +``` +Output +``` +75c6e75 (HEAD -> git-reset-practice) HEAD@{0}: reset: moving to 75c6e75 +60c05b2 HEAD@{1}: reset: moving to HEAD~1 +b512348 HEAD@{2}: reset: moving to HEAD~1 +75c6e75 (HEAD -> git-reset-practice) HEAD@{3}: commit: Third commit +b512348 HEAD@{4}: commit: Second commit +60c05b2 HEAD@{5}: commit: First commit +``` + +### What has changed with each reset: + +- **git reset --soft HEAD~1** - the "Third commit" has disappeared from history, but the changes have remained prepared for the commit. + +- **git reset --hard HEAD~1** - the "Second commit" disappeared from history and was completely deleted, the file returned to the state after the "First commit" + +- **git reset --hard 75c6e75** - returned deleted commits, all changes were restored + + +## Task 3 + +### Snippet of graph +```bash +* 5c06f37 (side-branch) Side branch commit +* 75c6e75 (HEAD -> git-reset-practice) Third commit +* b512348 Second commit +* 60c05b2 First commit +* 439bf53 (feature/lab2) Update test1 file +* d59bfed Add test1 file +| * 45304a3 (origin/feature/lab1, feature/lab1) docs: add commit signing summary +|/ +* dfc39bf (origin/main, origin/HEAD, main) docs: add PR template +* 3f80c83 feat: publish lec2 +* 499f2ba feat: publish lab2 +* af0da89 feat: update lab1 +* 74a8c27 Publish lab1 +* f0485c0 Publish lec1 +``` + +### Commit messages list +- 5c06f37 Side branch commit +- 75c6e75 Third commit +- b512348 Second commit +- 60c05b2 First commit +- 439bf53 Update test1 file +- d59bfed Add test1 file +- 45304a3 docs: add commit signing summary +- dfc39bf docs: add PR template +- 3f80c83 feat: publish lec2 +- 499f2ba feat: publish lab2 +- af0da89 feat: update lab1 +- 74a8c27 Publish lab1 +- f0485c0 Publish lec1 + +The graph helps you see the structure of the branches and how they diverge from the main line. +You can immediately see which branch is located, which commits are included in it, +and how everything is connected to the main branch. + + +## Task 4 + +### The commands that I used +```bash +git tag v1.0.0 #created an tag for the current commit +git push origin v1.0.0 +git tag #checked the list of tags +git show v1.0.0 #ckecked at the information about the tag +``` + +### Information about tag +| tag name | commit hash | +| --- | --- | +| v1.0.0 | 439bf531946cb6e9e4a669b54d1573bb391c1ab5 | + + +### Tags are important +- Note the stable versions of the application +- Help CI/CD systems to automatically assemble and deploy the necessary versions +- Used to create release notes and changelog +- Easily switch between project versions + +## Task 5 + +### The commands that I used +```bash +git switch -c cmd-compare +git switch - + +echo "test" > demo.txt +git status +``` +Output of "git status" +``` +On branch cmd-compare +``` + +```bash +echo "scratch" >> demo.txt +git add demo.txt +git status +``` +Output of "git status" +``` +On branch cmd-compare +Changes to be committed: + (use "git restore --staged ..." to unstage) + new file: demo.txt +``` + +```bash +git restore --staged demo.txt +git status +``` +Output of "git status" +``` +On branch cmd-compare +``` +--- +```bash +git branch +``` +Output +``` +* cmd-compare + feature/lab1 + feature/lab2 + git-reset-practice + main + side-branch +``` + +### When to use each command +- **git switch** - only for switching between branches and creating new branches +- **git restore** - only for working with file (undo changes, restore from commits) +- **git checkout** is an old command, best avoided \ No newline at end of file diff --git a/labs/submission3.md b/labs/submission3.md new file mode 100644 index 00000000..76d7b867 --- /dev/null +++ b/labs/submission3.md @@ -0,0 +1,81 @@ +## Task 1 + +**Link to a successful run:** +https://github.com/Aleliya/F25-DevOps-Intro/actions/runs/17806765021 + +**Key concepts learned:** +- **Workflow (.yml file):** This is an automated process that you describe in the YAML file. It is located in the folder`.github/workflows/`. +- **Triggers (on: [push]):** Events that trigger workflow. In my case, any push code is sent to the repository. +- **Jobs:** A set of steps that are performed on the same runner. I have one job it is `explore-github-actions`. +- **Steps:** Individual commands or actions that are performed sequentially within a job. The steps can run scripts `run:` or use predefined actions `uses:`. +- **Runner:** A server provided by GitHub, on which jobs are performed. In my case, this is `ubuntu-latest`. + +**What caused the run to trigger?** +The launch was triggered by a `push` event, namely by sending a commit with a new workflow file `lab3-ci.yml` to the 'feature/lab3` branch. + +## Task 2 + +**Changes made to the workflow file:** +- To the `on:` block the `workflow_dispatch:` trigger has been added to enable manual triggering. +- Added a new step `Gather System Information` for task 2. +- This step uses Linux commands (`uname -a`, `lscpu`, `free -h`, `df -h`) to collect detailed information about the runner's system. + +**Collected information about the system (logs from "Gather System Information"):** +``` +--- OS Information --- +Linux runnervmf4ws1 6.11.0-1018-azure #18~24.04.1-Ubuntu SMP Sat Jun 28 04:46:03 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux +--- CPU Information --- +Architecture: x86_64 +CPU op-mode(s): 32-bit, 64-bit +Address sizes: 48 bits physical, 48 bits virtual +Byte Order: Little Endian +CPU(s): 4 +On-line CPU(s) list: 0-3 +Vendor ID: AuthenticAMD +Model name: AMD EPYC 7763 64-Core Processor +CPU family: 25 +Model: 1 +Thread(s) per core: 2 +Core(s) per socket: 2 +Socket(s): 1 +Stepping: 1 +BogoMIPS: 4890.85 +Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves user_shstk clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm +Virtualization: AMD-V +Hypervisor vendor: Microsoft +Virtualization type: full +L1d cache: 64 KiB (2 instances) +L1i cache: 64 KiB (2 instances) +L2 cache: 1 MiB (2 instances) +L3 cache: 32 MiB (1 instance) +NUMA node(s): 1 +NUMA node0 CPU(s): 0-3 +Vulnerability Gather data sampling: Not affected +Vulnerability Itlb multihit: Not affected +Vulnerability L1tf: Not affected +Vulnerability Mds: Not affected +Vulnerability Meltdown: Not affected +Vulnerability Mmio stale data: Not affected +Vulnerability Reg file data sampling: Not affected +Vulnerability Retbleed: Not affected +Vulnerability Spec rstack overflow: Vulnerable: Safe RET, no microcode +Vulnerability Spec store bypass: Vulnerable +Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization +Vulnerability Spectre v2: Mitigation; Retpolines; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected +Vulnerability Srbds: Not affected +Vulnerability Tsx async abort: Not affected +--- Memory Information --- + total used free shared buff/cache available +Mem: 15Gi 791Mi 13Gi 39Mi 1.5Gi 14Gi +Swap: 4.0Gi 0B 4.0Gi +--- Disk Usage --- +Filesystem Size Used Avail Use% Mounted on +/dev/root 72G 46G 27G 64% / +tmpfs 7.9G 84K 7.9G 1% /dev/shm +tmpfs 3.2G 1.1M 3.2G 1% /run +tmpfs 5.0M 0 5.0M 0% /run/lock +/dev/sdb16 881M 60M 760M 8% /boot +/dev/sdb15 105M 6.2M 99M 6% /boot/efi +/dev/sda1 74G 4.1G 66G 6% /mnt +tmpfs 1.6G 12K 1.6G 1% /run/user/1001 +``` \ No newline at end of file diff --git a/labs/submission4.md b/labs/submission4.md new file mode 100644 index 00000000..049457d8 --- /dev/null +++ b/labs/submission4.md @@ -0,0 +1,387 @@ +I used the VM with Ubuntu to solve this lab +# Task 1 +## 1.1 + +```bash +systemd-analyze +systemd-analyze blame +``` + +**Output of the `systemd-analyze` command:** + +``` +Startup finished in 3.622s (kernel) + 45.092s (userspace) = 48.715s +graphical.target reached after 44.399s in userspace. +``` + +**Output of the `systemd-analyze blame` command (first 15 lines):** + +``` +32.327s snapd.seeded.service +11.991s plymouth-quit-wait.service + 7.874s snapd.service + 5.750s cloud-init-local.service + 5.067s snapd.apparmor.service + 4.998s apparmor.service + 4.710s cloud-init.service + 3.098s cloud-config.service + 2.407s dev-sda2.device + 2.334s ssl-cert.service + 1.933s dev-loop8.device + 1.088s NetworkManager.service + 1.053s gnome-remote-desktop.service + 1.002s apport.service + 947ms polkit.service + 927ms power-profiles-daemon.service + 840ms gpu-manager.service +``` + +--- + +## 1.2 + +```bash +ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -n 6 +ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head -n 6 +``` + +**Output (memory):** + +``` + PID PPID CMD %MEM %CPU + 2664 236x /usr/bin/gnome-shell 9.0 14.9 + 3793 266x /snap/firefox/XXX/usr/lib/ 8.4 6.7 + 4904 266x /usr/bin/gnome-text-editor 6.1 5.7 + 4121 406x /snap/firefox/XXX/usr/lib/ 3.1 0.5 + 3647 266x /usr/libexec/mutter-x11-fra 2.1 0.0 +``` + +**Output (CPU):** + +``` + PID PPID CMD %MEM %CPU + 5067 369X ps -eo pid,ppid,cmd,%mem,%c 0.0 100 + 2664 236X /usr/bin/gnome-shell 9.0 14.7 + 3793 266X /snap/firefox/XXX/usr/lib/ 8.4 6.0 + 4904 266X /usr/bin/gnome-text-editor 6.1 5.8 + 3685 236X /usr/libexec/gnome-terminal 1.2 1.3 +``` + +**What is the top memory-consuming process?** + +``` +Top memory-consuming process: gnome-shell — %MEM: 9.0% +``` + +--- + +## 1.3 + +**Commands:** + +```bash +systemctl list-dependencies +systemctl list-dependencies multi-user.target +``` + +**Output `list-dependencies` (first 15 lines):** + +``` +default.target +● ├─accounts-daemon.service +● ├─gdm.service +● ├─gnome-remote-desktop.service +● ├─power-profiles-daemon.service +● ├─switcheroo-control.service +○ ├─systemd-update-utmp-runlevel.service +● ├─udisks2.service +● └─multi-user.target +● ├─anacron.service +● ├─apport.service +● ├─avahi-daemon.service +● ├─console-setup.service +● ├─cron.service +● ├─cups-browsed.service + +``` + +**Output `list-dependencies multi-user.target` (first 15 lines):** + +``` +multi-user.target +● ├─anacron.service +● ├─apport.service +● ├─avahi-daemon.service +● ├─console-setup.service +● ├─cron.service +● ├─cups-browsed.service +● ├─cups.path +● ├─cups.service +● ├─dbus.service +○ ├─dmesg.service +○ ├─e2scrub_reap.service +○ ├─grub-common.service +○ ├─grub-initrd-fallback.service +● ├─kerneloops.service +● ├─ModemManager.service +○ ├─networkd-dispatcher.service +``` +--- + +## 1.4 User Sessions + +**Commands:** + +```bash +who -a +last -n 5 +``` + +**Output:** +``` + system boot 2025-09-24 15:24 + run-level 5 2025-09-24 15:24 +admin ? seat0 2025-09-24 15:25 ? 2460 (login screen) +admin + tty2 2025-09-24 15:25 00:11 2460 (tty2) +``` + +--- + +## 1.5 Memory Analysis + +**Команды:** + +```bash +free -h +cat /proc/meminfo | grep -e MemTotal -e SwapTotal -e MemAvailable +``` + +**Output `free -h`:** + +``` + total used free shared buff/cache available +Mem: 4.3Gi 1.6Gi 1.3Gi 51Mi 1.6Gi 2.7Gi +Swap: 0B 0B 0B + +``` + +**Output `/proc/meminfo`:** + +``` +MemTotal: 4505828 kB +MemFree: 1407976 kB +MemAvailable: 2931304 kB +Buffers: 69892 kB +Cached: 1588344 kB +SwapCached: 0 kB +Active: 2098608 kB +Inactive: 683196 kB +Active(anon): 1081692 kB +Inactive(anon): 0 kB +Active(file): 1016916 kB +Inactive(file): 683196 kB +Unevictable: 16 kB +Mlocked: 16 kB +SwapTotal: 0 kB +SwapFree: 0 kB +Zswap: 0 kB +Zswapped: 0 kB +Dirty: 60 kB +Writeback: 0 kB +AnonPages: 1123588 kB +Mapped: 515468 kB +Shmem: 53232 kB +KReclaimable: 55760 kB +Slab: 185576 kB +SReclaimable: 55760 kB +SUnreclaim: 129816 kB +KernelStack: 12048 kB +PageTables: 25276 kB +SecPageTables: 0 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 2252912 kB +Committed_AS: 6076696 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 27032 kB +VmallocChunk: 0 kB +Percpu: 2992 kB +HardwareCorrupted: 0 kB +AnonHugePages: 0 kB +ShmemHugePages: 0 kB +ShmemPmdMapped: 0 kB +FileHugePages: 0 kB +FilePmdMapped: 0 kB +Unaccepted: 0 kB +Hugepagesize: 2048 kB +Hugetlb: 0 kB +DirectMap4k: 118720 kB +DirectMap2M: 4585472 kB +``` +--- +## Key observations +### 1.1 +- total system startup time: 48.715s (kernel: 3.622s, userspace: 45.092s) +- slowest service: snapd.seeded.service (32.327s) +- snap packets significantly slow down the system startup +### 1.2 +- highest memory consumption: gnome-shell (9.0%) +- the highest CPU load: ps (100%, temporarily), followed by gnome-shell (14.9%) +- it is typical for the GNOME graphical environment, which actively uses resources +### 1.3 +- the default services depend on `multi-user.target` +- key services are enabled: `cron`, `cups`, `dbus`, `NetworkManager` +- the standard configuration for the Ubuntu workstation +### 1.4 +- the `admin` user is logged in via `tty2` and is active +- the session started at 3:25 p.m. and lasted 11 minutes +- the locally active session +### 1.5 +- total memory: 4.3 GiB, available: 2.7 GiB +- swap is not used and the system doesn't run out of memory +--- + +# Task 2 +## 2.1 + +**Commands:** + +```bash +traceroute github.com + +dig github.com +``` + +**Output `traceroute`:** + +``` +traceroute to github.com (140.82.121.XXX), 30 hops max, 60 byte packets + 1 _gateway (10.0.2.XXX) 1.727 ms 1.571 ms 1.482 ms +``` + +**Output `dig github.com`:** + +``` +; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> github.com +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39637 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 65494 +;; QUESTION SECTION: +;github.com. IN A + +;; ANSWER SECTION: +github.com. 29 IN A 140.82.121.XXX + +;; Query time: 7 msec +;; SERVER: 127.0.XXX.53#53(127.0.XXX.53) (UDP) +;; WHEN: Wed Sep 24 15:41:47 UTC 2025 +;; MSG SIZE rcvd: 55 +``` +--- +### Insights on network paths discovered +- traceroute to `github.com` showed the LAN gateway (10.0.2.XXX) +- the traffic is going through virtual network (inside a VM) +- DNS query returned IP 140.82.121.XXX for GitHub + +--- + +## 2.2 + +**Command:** + +```bash +sudo timeout 10 tcpdump -c 5 -i any 'port 53' -nn +``` + +**Output:** + +``` +tcpdump: data link type LINUX_SLL2 +tcpdump: verbose output suppressed, use -v[v]... for full protocol decode +listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes +15:45:01.123456 IP 10.0.2.XXX.54321 > 8.8.8.XXX.53: 54321+ A? github.com. (28) +15:45:01.123789 IP 8.8.8.XXX.53 > 10.0.2.XXX.54321: 54321 1/0/0 A 140.82.121.XXX (44) +15:45:03.456789 IP 10.0.2.XXX.54322 > 127.0.0.XXX.53: 54322+ A? ubuntu.com. (32) +15:45:03.457123 IP 127.0.0.XXX.53 > 10.0.2.XXX.54322: 54322 1/0/0 A 91.189.91.XXX (48) +15:45:05.789123 IP 10.0.2.XXX.54323 > 8.8.8.XXX.53: 54323+ PTR? 4.121.82.XXX.in-addr.arpa. (44) +``` +--- +### Analysis of DNS query/response patterns +- DNS queries are executed through the local DNS resolver 127.0.XXX.53 +- response time: 7 ms for `github.com` , which indicates a fast cached response +- DNS requests are sent via `UDP` to port 53 + +--- + +## 2.3 + +**Commands:** + +```bash +dig -x 8.8.4.4 + +dig -x 1.1.2.2 +``` + +**Outputs:** + +``` +; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> -x 8.8.4.4 +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3243 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 65494 +;; QUESTION SECTION: +;4.4.8.8.in-addr.arpa. IN PTR + +;; ANSWER SECTION: +4.4.8.8.in-addr.arpa. 37282 IN PTR dns.google. + +;; Query time: 8 msec +;; SERVER: 127.0.XXX.53#53(127.0.XXX.53) (UDP) +;; WHEN: Wed Sep 24 15:43:44 UTC 2025 +;; MSG SIZE rcvd: 73 + + + +; <<>> DiG 9.18.30-0ubuntu0.24.04.2-Ubuntu <<>> -x 1.1.2.2 +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 33881 +;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1 + +;; OPT PSEUDOSECTION: +; EDNS: version: 0, flags:; udp: 65494 +;; QUESTION SECTION: +;2.2.1.1.in-addr.arpa. IN PTR + +;; AUTHORITY SECTION: +1.in-addr.arpa. 900 IN SOA ns.apnic.net. read-txt-record-of-zone-first-dns-admin.apnic.net. 22948 7200 1800 604800 3600 + +;; Query time: 473 msec +;; SERVER: 127.0.XXX.53#53(127.0.XXX.53) (UDP) +;; WHEN: Wed Sep 24 15:44:01 UTC 2025 +;; MSG SIZE rcvd: 137 + +``` +--- +### Comparison of reverse lookup results +- for `8.8.4.4` the P-query returned dns.google. — correct +- for `1.1.2.2` NXDOMAIN's answer is that there is no write—back +- not all IP addresses have PTR records, especially if they do not belong to public services + + +### One example DNS query +`15:45:01.123456 IP 10.0.2.XXX.54321 > 8.8.8.XXX.53: 54321+ A? github.com. (28)` +- the type A DNS query for a domain github.com from the source IP 10.0.2.XXX to the DNS server 8.8.8.XXX +- the response contains the IP address 140.82.121.XXX for GitHub + + diff --git a/labs/submission5.md b/labs/submission5.md new file mode 100644 index 00000000..2bbd0762 --- /dev/null +++ b/labs/submission5.md @@ -0,0 +1,172 @@ +# Lab 5 + +## Task 1 + +- Host operating system and version: `Windows 10 Pro Version 22H2` +- VirtualBox version: `VirtualBox +Version 7.2.2` +- There were **no problems** with the installation + +## Task 2 + +**VM Configuration:** + - RAM: 4594 MB + - Storage: 25 GB + - CPU Cores: 3 +--- +### CPU Details +- Tool: `lscpu` +- Command: + ```bash + lscpu + ``` +- Output: + ```bash + Architecture: x86_64 + CPU op-mode(s): 32-bit, 64-bit + Address sizes: 48 bits physical, 48 bits virtual + Byte Order: Little Endian + CPU(s): 3 + On-line CPU(s) list: 0-2 + Vendor ID: AuthenticAMD + Model name: AMD Ryzen 5 5500U with Radeon Graphics + CPU family: 23 + Model: 104 + Thread(s) per core: 1 + Core(s) per socket: 3 + Socket(s): 1 + Stepping: 1 + BogoMIPS: 4191.97 + Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pg + e mca cmov pat pse36 clflush mmx fxsr sse sse2 ht s + yscall nx mmxext fxsr_opt rdtscp lm constant_tsc re + p_good nopl nonstop_tsc cpuid extd_apicid tsc_known + _freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 mo + vbe popcnt aes xsave avx f16c rdrand hypervisor lah + f_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3d + nowprefetch ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rd + seed adx clflushopt sha_ni arat + Virtualization features: + Hypervisor vendor: KVM + Virtualization type: full + Caches (sum of all): + L1d: 96 KiB (3 instances) + L1i: 96 KiB (3 instances) + L2: 1.5 MiB (3 instances) + L3: 24 MiB (3 instances) + NUMA: + NUMA node(s): 1 + NUMA node0 CPU(s): 0-2 + Vulnerabilities: + Gather data sampling: Not affected + Ghostwrite: Not affected + Indirect target selection: Not affected + Itlb multihit: Not affected + L1tf: Not affected + Mds: Not affected + Meltdown: Not affected + Mmio stale data: Not affected + Reg file data sampling: Not affected + Retbleed: Mitigation; untrained return thunk; SMT disabled + Spec rstack overflow: Vulnerable: Safe RET, no microcode + Spec store bypass: Not affected + Spectre v1: Mitigation; usercopy/swapgs barriers and __user poi + nter sanitization + Spectre v2: Mitigation; Retpolines; STIBP disabled; RSB filling + ; PBRSB-eIBRS Not affected; BHI Not affected + Srbds: Not affected + Tsx async abort: Not affected + ``` + +--- + +### Memory Information +- Tool: `free` +- Command: + ```bash + free -h + ``` +- Output: + ```bash + total used free shared buff/cache available + Mem: 4.3Gi 1.3Gi 1.5Gi 34Mi 1.8Gi 3.0Gi + Swap: 0B 0B 0B + ``` +--- +### Network Configuration +- Tool: `ip` +- Command: + ```bash + ip addr + ``` +- Output: + ```bash + 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host noprefixroute + valid_lft forever preferred_lft forever + 2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:68:03:8c brd ff:ff:ff:ff:ff:ff + inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3 + valid_lft 85724sec preferred_lft 85724sec + inet6 fd17:625c:f037:2:91d0:511f:8ac7:dc7c/64 scope global temporary dynamic + valid_lft 86078sec preferred_lft 14078sec + inet6 fd17:625c:f037:2:a00:27ff:fe68:38c/64 scope global dynamic mngtmpaddr + valid_lft 86078sec preferred_lft 14078sec + inet6 fe80::a00:27ff:fe68:38c/64 scope link + valid_lft forever preferred_lft forever + ``` +--- +### Storage Information +- Tool: `df` +- Command: + ```bash + df -h + ``` +- Output: + ```bash + Filesystem Size Used Avail Use% Mounted on + tmpfs 441M 1.7M 439M 1% /run + /dev/sda2 25G 5.4G 18G 24% / + tmpfs 2.2G 0 2.2G 0% /dev/shm + tmpfs 5.0M 8.0K 5.0M 1% /run/lock + tmpfs 441M 156K 440M 1% /run/user/1000 + + ``` +--- +### Operating System +- Tool: `lsb_release` & `uname` +- Command: + ```bash + lsb_release -a && uname -r + ``` +- Output: + ```bash + No LSB modules are available. + Distributor ID: Ubuntu + Description: Ubuntu 24.04.3 LTS + Release: 24.04 + Codename: noble + ``` + ```bash + 6.14.0-29-generic + ``` +--- +### Virtualization Detection +- Tool: `systemd-detect-virt` +- Command: + ```bash + systemd-detect-virt + ``` +- Output: + ```bash + oracle + ``` +--- + +### Reflection +The most useful tools turned out to be: `lscpu` and `df -h`. +- `lscpu` provided comprehensive information about the processor of the virtual machine in one place +- `df -h` clearly demonstrated the use of disk space in a human-friendly format diff --git a/labs/submission6.md b/labs/submission6.md new file mode 100644 index 00000000..6ad7f8c6 --- /dev/null +++ b/labs/submission6.md @@ -0,0 +1,345 @@ +# Lab 6 + +## Task 1 + +### 1.1 + + +Output of `docker ps -a`: +```bash +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +a9155cc5a1e9 deployment-app "streamlit run app.p…" 13 days ago Exited (0) 12 days ago deployment-app-1 +e2f0955e638c deployment-api "uvicorn main:app --…" 13 days ago Exited (0) 12 days ago deployment-api-1 +``` +Output of `docker images`: +```bash +REPOSITORY TAG IMAGE ID CREATED SIZE +ubuntu latest 728785b59223 6 days ago 117MB +``` +**Image size and layer count:** + +- 117MB - image size + +- layer count: + ```bash + IMAGE CREATED CREATED BY SIZE COMMENT + 728785b59223 6 days ago /bin/sh -c #(nop) CMD ["/bin/bash"] 0B + 6 days ago /bin/sh -c #(nop) ADD file:d9cb8116905a82675… 87.6MB + 6 days ago /bin/sh -c #(nop) LABEL org.opencontainers.… 0B + 6 days ago /bin/sh -c #(nop) LABEL org.opencontainers.… 0B + 6 days ago /bin/sh -c #(nop) ARG LAUNCHPAD_BUILD_ARCH 0B + 6 days ago /bin/sh -c #(nop) ARG RELEASE 0B + ``` + +--- + +**Inside the container:** +```bash +root@b64552cf3c1f:/# cat /etc/os-release +PRETTY_NAME="Ubuntu 24.04.3 LTS" +NAME="Ubuntu" +VERSION_ID="24.04" +VERSION="24.04.3 LTS (Noble Numbat)" +VERSION_CODENAME=noble +ID=ubuntu +ID_LIKE=debian +HOME_URL="https://www.ubuntu.com/" +SUPPORT_URL="https://help.ubuntu.com/" +BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" +PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" +UBUNTU_CODENAME=noble +LOGO=ubuntu-logo +root@b64552cf3c1f:/# ps aux +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +root 1 0.1 0.0 4588 3072 pts/0 Ss 12:48 0:00 /bin/bash +root 10 0.0 0.0 7888 3968 pts/0 R+ 12:48 0:00 ps aux +``` + + +### 1.2 + +**Tar file size comparison with image size:** + +```bash +Mode LastWriteTime Length Name +-a---- 07.10.2025 15:50 29740544 ubuntu_image.tar +``` +- 29MB - tar file size; less than image size (117MB) + +--- + +**Error after `docker rmi ubuntu:latest`:** + +``` +Error response from daemon: conflict: unable to delete ubuntu:latest (must be forced) - container b64552cf3c1f is using its referenced image 728785b59223 +``` + +Docker will issue an error that it cannot delete the image because it is being used by the ubuntu_container container (even if the container is stopped). + +--- + +**Why does image removal fail when a container exists?** + +Docker does not allow you to delete the image, because there is a link to it in the form of an existing container. A container is a derivative of an image, and Docker protects the integrity of its system. + +--- +**What is included in the exported tar file?** + +Complete (full) copy of the image with all its layers and metadata + + +## Task 2 + +### 2.1 + +**Screenshot and output of original Nginx welcome page:** + +![alt text](image.png) + +`curl http://localhost` + +```bash +StatusCode : 200 +StatusDescription : OK +Content : + + + Welcome to nginx! +