Skip to content

Logstash S3 Output plugin requires both access_key_id and secret_access_key (if both not provided throws errors) #261

Open
@tcalvillo

Description

@tcalvillo

Logstash information:

Please include the following information:

  1. Logstash version (e.g. bin/logstash --version): 8.12.0
  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker): RPM
  3. How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes): via command line on Centos EC2 instance
  4. How was the Logstash Plugin installed: sudo yum install logstash (it got automatically installed, I checked using bin/logstash-plugin list)

JVM (e.g. java -version): 11.0.22

If the affected version of Logstash is 7.9 (or earlier), or if it is NOT using the bundled JDK or using the 'no-jdk' version in 7.10 (or higher), please provide the following information:

  1. JVM version (java -version)
  2. JVM installation source (e.g. from the Operating System's package manager, from source, etc).
  3. Value of the JAVA_HOME environment variable if set.

OS version (uname -a if on a Unix-like system): Linux ip-10-147-116-224.xxx 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
In the documentation: https://www.elastic.co/guide/en/logstash/current/plugins-outputs-s3.html, is clearly written (look the example in "Usage" and "S3 Output Configuration Options") that both access_key_id and secret_access_key are optional.
However, if you do NOT include these info, you do get errors. In the specific, if you do NOT provide any of the two information, you will get as result the error: "key must not be blank". If you do provide the access_key_id but NOT the secret_access_key you will get as result the error "unable to sign request without credentials set".
The documentation is misleading because makes you believe that only the name of the bucket is required.

Steps to reproduce:
cd /usr/share/logstash/bin/
/usr/share/logstash/bin/logstash -f /usr/share/logstash/first-pipeline.conf

Below my "first-pipeline.conf" file:

input {  beats {
    port => 5044
  }
}

output {
   s3{
     region => "eu-west-1"
     bucket => "mybucketname"
     access_key_id => "ciao.txt"
     secret_access_key => ""
   }
}

Please include a minimal but complete recreation of the problem,
including (e.g.) pipeline definition(s), settings, locale, etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.

  1. Create file first-pipeline.conf as above in the Logstash Home (in my case /usr/share/logstash/ )
  2. Be sure that you grant ownership to logstash:logstash using chown and enough privileges in the folder /usr/share/logstash/ . In my case I used chmod 600 -R /usr/share/logstash/
  3. In the bin folder (where there are the executable, in my case /usr/share/logstash/bin/) run bin/logstash -f /usr/share/logstash/first-pipeline.conf

Provide logs (if relevant):

Thanks for looking into :)

Regards,
Tizi


Added by @mashhurs

Expectation

The user expectation with this issue is persisting data on S3 without credentials using --no-sign-request of AWS API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions