Git Product home page Git Product logo

Comments (6)

domofactor avatar domofactor commented on August 15, 2024

its worth noting that i've made sure there are no newlines in the secret.pem file itself in S3.

from citadel.

coderanger avatar coderanger commented on August 15, 2024

Hmm, how are you verifying there is no newline in the file on S3? I don't see anything in the code that would risk a rogue character being added, just a straight HTTP GET call :-/

from citadel.

domofactor avatar domofactor commented on August 15, 2024

I just echo'ed a sample string into a new file and cat it.

What I upload to S3:

falcon@nest:~$ echo 'supersecret' > secret.pem
falcon@nest:~$ cat secret.pem
supersecret
falcon@nest:~$

Example of a file containing a newline:

falcon@nest:~$ echo -e "supersecret\n" > secret.pem
falcon@nest:~$ cat secret.pem
supersecret

falcon@nest:~$

I totally agree with you, code wise it doesn't look like any newlines are being added, but it seems to me that S3 itself is returning the new line for some reason.

Maybe i'm just nuts? lol i'll try to do some more digging shortly.

from citadel.

mjallday avatar mjallday commented on August 15, 2024

@domofactor try echo -n 'supersecret'

man echo
...

-n Do not print the trailing newline character

from citadel.

coderanger avatar coderanger commented on August 15, 2024

Closing this as not reproducible.

from citadel.

nullck avatar nullck commented on August 15, 2024

@coderanger I can reproduce this:

try to create a template like this:

template "/tmp/test" do
source "test.erb"
owner "root"
group "root"
mode 0660
variables({
:password => node['cookbook_teste]['password']
})
end

will generate this:

cat /tmp/test
password=P455word

if I create a file in my s3 bucket with this content:
P455word

and modify my recipe to use citadel like this:

template "/tmp/test_citadel" do
source "test.erb"
owner "root"
group "root"
mode 0660
variables({
:password => citadel['keys_secrets/password']
})
end

The result will be a /tmp/test_citadel with this content, including a breakline
P455word

diff between files /tmp/test /tmp/test_citadel

12:04:13 ip-10-0-54-20:~# diff /tmp/teste /tmp/teste_citadel
2a3

from citadel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.