avatarTeri Radichel

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2368

Abstract

ro.readmedium.com/v2/resize:fit:320/1*4oxP4LXk8l8c3mpRvO7ejg.png)"></div> </div> </div> </a> </div><p id="4c23">This was the end result of that post:</p><blockquote id="bfbf"><p>So I’m wondering if it has to do with sourcing the same file from two different directories in the same script — but I’m not sure.</p></blockquote><p id="a4c5">Well, I’m sourcing the same files from within multiple scripts in a bunch of places and hasn’t caused a problem till now. Hmm.</p><p id="ceb6">Well, I comment out the the sourced file that I suspect is the problem from the last script.</p><figure id="7585"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*EzraTkODI9GuPP9Xvfh_kg.png"><figcaption></figcaption></figure><p id="86cf">That confirms that something in a sourced file is causing the segmentation fault.</p><p id="b23d">Let’s head over to that file.</p><p id="ab96">I’m sourcing some things at the top of the file, some of which are redundant. Hmm. But let’s start by commenting out the last two:</p><figure id="3eba"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*0S7iVJbCrxns3o88MOjboQ.png"><figcaption></figcaption></figure><p id="7159">Like this:</p><figure id="ab61"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*9BbIUl9uU130ujMXETHRBQ.png"><figcaption></figcaption></figure><p id="2716">When I comment out those files I don’t get the error anymore even when I include the above file that was previously causing a problem.</p><p id="340d">I verify that both those files exist. Then I take a look at those files.</p><p id="188e">My route table file also references the shared functions:</p><figure id="787e"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*oIsRFcELXKWqbXPnmu0dYg.png"><figcaption></figcaption></figure><p id="9c82">Here’s something interesting. The security group file tries to include the VPC file:</p><figure id="b30e"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*yg2zE3Z4DJNlY6kQEIKRyw.png"><figcaption></figcaption></figure><p id="a4e8">So then the VPC file will try to include the security group file.</p><p id="eb82">And there we have a circular dependency.</p><p id="46f7">Let’s remove the VPC file from the security group sourced files and see what happens.</p><figure id="da68"><img src="https://cdn-ima

Options

ges-1.readmedium.com/v2/resize:fit:800/1*ENl2nnJeYG_2Lr_ODfLsDg.png"><figcaption></figcaption></figure><p id="1c2e">I restore the sourced files in the <i>vpc_functions.sh</i> file:</p><figure id="f702"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*08eZ5V1Xn86oFBvUUv7NDw.png"><figcaption></figcaption></figure><p id="54c9">And no segmentation fault.</p><p id="1f38">So what can I do if I need to reference a function in the VPC file when deploying security groups? I can move those particular functions to a shared network_functions file to alleviate the circular dependency.</p><p id="3d17">I wish the error message was more specific as to what the problem was in this case but figured it out with a little investigation.</p><p id="0804">Follow for updates.</p><p id="4a3a">Teri Radichel | <i>© <a href="https://2ndsightlab.com/?source=post_page---------------------------">2nd Sight Lab</a> 2023</i></p><div id="8b5f"><pre><span class="hljs-section">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</pre></div><div id="caae"><pre><span class="hljs-section">Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation</pre></div><div id="8157"><pre>Follow <span class="hljs-keyword">for</span> more stories like <span class="hljs-keyword">this</span>:

❤️ Sign Up my Medium Email List ❤️ Twitter: <span class="hljs-meta">@teriradichel</span> ❤️ LinkedIn: https:<span class="hljs-comment">//www.linkedin.com/in/teriradichel</span> ❤️ Mastodon: <span class="hljs-meta">@teriradichel</span><span class="hljs-meta">@infosec</span>.exchange ❤️ Facebook: 2nd Sight Lab ❤️ YouTube: @2ndsightlab</pre></div><figure id="7286"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*4oxP4LXk8l8c3mpRvO7ejg.png"><figcaption></figcaption></figure></article></body>

Segmentation fault trying to deploy CloudFormation template using AWS CLI

Segmentation fault (core dumped)

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

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

🔒 Related Stories: Bugs | AWS Security | Secure Code

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

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

Hmmm…

./deploy/root-orgadminrole/organizations_account_project.sh: line 67: 1398 Segmentation fault (core dumped)

What is causing this, I wonder? And where was the core dumpted?

Let’s take a look at line 67.

It’s trying to open a file:

Let’s try to open the file. I don’t see the problem. It looks like the other files I’ve deployed with similar code.

Well, I got a segmentation fault before and wrote about it here:

This was the end result of that post:

So I’m wondering if it has to do with sourcing the same file from two different directories in the same script — but I’m not sure.

Well, I’m sourcing the same files from within multiple scripts in a bunch of places and hasn’t caused a problem till now. Hmm.

Well, I comment out the the sourced file that I suspect is the problem from the last script.

That confirms that something in a sourced file is causing the segmentation fault.

Let’s head over to that file.

I’m sourcing some things at the top of the file, some of which are redundant. Hmm. But let’s start by commenting out the last two:

Like this:

When I comment out those files I don’t get the error anymore even when I include the above file that was previously causing a problem.

I verify that both those files exist. Then I take a look at those files.

My route table file also references the shared functions:

Here’s something interesting. The security group file tries to include the VPC file:

So then the VPC file will try to include the security group file.

And there we have a circular dependency.

Let’s remove the VPC file from the security group sourced files and see what happens.

I restore the sourced files in the vpc_functions.sh file:

And no segmentation fault.

So what can I do if I need to reference a function in the VPC file when deploying security groups? I can move those particular functions to a shared network_functions file to alleviate the circular dependency.

I wish the error message was more specific as to what the problem was in this case but figured it out with a little investigation.

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
Segmentation Fault
Circular Dependencies
Bash
Amazon Linux 2
Source
Recommended from ReadMedium