avatarTeri Radichel

Summary

Teri Radichel discusses an issue with AWS CloudShell where code formatting is lost and files are not saved properly upon re-login, leading to a frustrating experience with the tool's integrity and reliability.

Abstract

The author, Teri Radichel, has encountered persistent problems with code formatting and file integrity when using AWS CloudShell. After spending considerable time aligning code for blog posts, she found that the formatting would be disrupted upon subsequent logins, despite having saved the files. This issue is exacerbated by CloudShell's copy and paste functionality not working correctly, causing additional time to fix the alignment. Radichel suspects that the problem may be related to temporary files that remain after a session timeout, which can lead to the original file not reflecting the latest edits. Although she has considered potential user errors, she also suggests that there might be underlying issues with CloudShell itself. She advises checking for hidden temporary files using the ls -al command and remains cautious about relying on CloudShell for serious code editing, viewing it only as a temporary solution until she can migrate her AMIs to a new account.

Opinions

  • The author believes that AWS CloudShell is currently not reliable for code editing due to issues with code formatting persistence and file saving.
  • Radichel suggests that the problem might be related to how CloudShell handles session timeouts and temporary files, which can result in the loss of code and formatting changes.
  • She expresses frustration with the time-consuming nature of fixing the formatting issues, which are not typically encountered in non-CloudShell environments.
  • The author plans to monitor the situation closely but is skeptical about the suitability of CloudShell as a serious tool for editing code.
  • Radichel provides a practical tip for users experiencing similar issues, recommending the use of the ls -al command to reveal hidden files that might be causing the problem.

AWS CloudShell integrity and formatting issue

Code written in AWS CloudShell has messed up formatting the next time I login

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️ Check out my series on Automating Cybersecurity Metrics | Code.

🔒 Related Stories: Bugs | AWS Security | Secure Code | CloudFormation

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I wrote some code in CloudShell. I only stored that code in CloudShell for the time being while I’m testing things out.

I correctly formatted all the code to align nicely so I could copy it into blog posts, painstakingly because CloudShell copy and paste doesn’t work correctly and code alignment goes haywire. This happens even between files in CloudShell to another file in CloudShell. I don’t know if it is specific to Chrome and Mac or something else but it’s quite time-consuming to fix and I am not planning to use this approach long term.

So anyway, I fix all the formatting and log out. The next day I return and my formatting is all messed up again.

Today my perfectly aligned code (yesterday) looks like this:

How does this happen?

So I’m looking at my file and actually some of the code is missing. I can see this because I have screen shots of the code.

One thing I noticed is that when I logged in a temporary file existed which I had to delete (starting with [.])

The thing is, I’m 99% sure I saved that file. This same thing has happened two days in a row. So perhaps I caused this. But when I work in non-CloudShell environments, I rarely ever have this issue unless I purposely have to kill my session for some reason, and then I immediately delete the temp file and fix the code. I’ll have to monitor it more closely going forward, but it feels like something is amiss.

If you are getting a warning about a file existing when trying to edit files in vi, run this command to see the hidden files (in Linux/Mac):

ls -al

You will seen files that start with a dot [.] indicating those are hidden files. Temp files related to something you were editing when your terminal session ended will be there as well.

One issue that causes this is when you are looking at a file and your session times out. At that point, your open temp file remains. When you re-open CloudShell you’ll have that hidden file sitting there and your existing file will retain whatever code you had in it prior to your edits. This is why I don’t see CloudShell as a serious tool for editing but a short term work around until I get my AMIs moved over to the new account.

Anyway, even if that is the cause of the problem in some cases, it doesn’t make sense in the case above, because I was working with and repeatedly saving the file in question. If I had this issue while working with the file, I think I would have resolved it before logging out. But I’ll have to monitor and see if it happens again.

Follow for updates.

Teri Radichel | © 2nd Sight Lab 2023

About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
Bug
Aws Cloudshell
File Integrity
Formatting
Bash
Recommended from ReadMedium