Skip to content

Commit ab65952

Browse files
authored
Merge pull request #2381 from adobe/security-and-contribution-clarifications
Security and contribution clarifications
2 parents 177cc69 + bb66f43 commit ab65952

File tree

5 files changed

+105
-23
lines changed

5 files changed

+105
-23
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ All third-party contributions to this project must be accompanied by a signed co
1616

1717
All submissions should come in the form of pull requests and need to be reviewed by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) for more information on sending pull requests.
1818

19+
All submissions must include unit tests for any new functionality or bug fixes. If you are adding a new feature, please include a test that demonstrates the feature.
20+
S3Mock uses Unit tests for function coverage, Spring Boot tests for component coverage, and integration tests against the Docker container artefact for end-to-end coverage. Please ensure that your code is covered by at least one of these test types.
21+
1922
Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when submitting a pull request!

README.md

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
* [Usage of AWS S3 SDKs](#usage-of-aws-s3-sdks)
1717
* [Path-style vs Domain-style access](#path-style-vs-domain-style-access)
1818
* [Presigned URLs](#presigned-urls)
19+
* [Self-signed SSL certificate](#self-signed-ssl-certificate)
1920
* [Usage of AWS CLI](#usage-of-aws-cli)
20-
* [Usage of plain HTTP](#usage-of-plain-http)
21+
* [Usage of plain HTTP / HTTPS with cURL](#usage-of-plain-http--https-with-curl)
2122
* [S3Mock configuration options](#s3mock-configuration-options)
2223
* [S3Mock Docker](#s3mock-docker)
2324
* [Start using the command-line](#start-using-the-command-line)
@@ -26,6 +27,7 @@
2627
* [Start using Docker compose](#start-using-docker-compose)
2728
* [Simple example](#simple-example)
2829
* [Expanded example](#expanded-example)
30+
* [Start using self-signed SSL certificate](#start-using-self-signed-ssl-certificate)
2931
* [S3Mock Java](#s3mock-java)
3032
* [Start using the JUnit4 Rule](#start-using-the-junit4-rule)
3133
* [Start using the JUnit5 Extension](#start-using-the-junit5-extension)
@@ -39,6 +41,9 @@
3941
* [Build & Run](#build--run)
4042
* [Java](#java)
4143
* [Kotlin](#kotlin)
44+
* [Governance model](#governance-model)
45+
* [Vulnerability reports](#vulnerability-reports)
46+
* [Security](#security)
4247
* [Contributing](#contributing)
4348
* [Licensing](#licensing)
4449
<!-- TOC -->
@@ -190,9 +195,18 @@ For instance, S3Mock does not verify the HTTP verb that the presigned uri was cr
190195

191196
S3 SDKs can be used to create presigned URLs pointing to S3Mock if they're configured for path-style access. See the "Usage of..." section above for links to examples on how to use the SDK with presigned URLs.
192197

198+
#### Self-signed SSL certificate
199+
200+
S3Mock supports connections via HTTP and HTTPS. It includes a self-signed SSL certificate which is rejected by most HTTP clients by default.
201+
To use HTTPS, the self-signed certificate must be accepted by the client.
202+
203+
On command line, this can be done by setting the `--no-verify-ssl` option in the AWS CLI or by using the `--insecure` option in cURL, see below.
204+
205+
Java and Kotlin SDKs can be configured to trust any SSL certificate, see links to `S3Client` creation above.
206+
193207
### Usage of AWS CLI
194208

195-
S3Mock can be used with the AWS CLI. Setting the `--endpoint-url` enables path-style access.
209+
S3Mock can be used with the AWS CLI. Setting the `--endpoint-url` enables path-style access, `--no-verify-ssl` is needed for HTTPS access.
196210

197211
Examples:
198212

@@ -211,9 +225,14 @@ Get object
211225
aws s3api get-object --bucket my-bucket --key my-file --endpoint-url=http://localhost:9090 my-file-output
212226
```
213227

214-
### Usage of plain HTTP
228+
Get object using HTTPS
229+
```shell
230+
aws s3api get-object --bucket my-bucket --key my-file --no-verify-ssl --endpoint-url=https://localhost:9191 my-file-output
231+
```
215232

216-
As long as the requests work with the S3 API, they will work with S3Mock as well.
233+
### Usage of plain HTTP / HTTPS with cURL
234+
235+
As long as the requests work with the S3 API, they will work with S3Mock as well. Use `--insecure` to ignore SSL errors.
217236

218237
Examples:
219238

@@ -229,7 +248,12 @@ curl --request PUT --upload-file ./my-file http://localhost:9090/my-test-bucket/
229248

230249
Get object
231250
```shell
232-
curl --request GET http://localhost:9090/my-test-bucket/my-file
251+
curl --request GET http://localhost:9090/my-test-bucket/my-file -O
252+
```
253+
254+
Get object using HTTPS
255+
```shell
256+
curl --insecure --request GET https://localhost:9191/my-test-bucket/my-file -O
233257
```
234258

235259
### S3Mock configuration options
@@ -272,7 +296,7 @@ Example with configuration via environment variables:
272296

273297
#### Start using the Fabric8 Docker-Maven-Plugin
274298

275-
Our [integration tests](integration-tests) are using the Amazon S3 Client to verify the server functionality against the S3Mock. During the Maven build, the Docker image is started using the [docker-maven-plugin](https://dmp.fabric8.io/) and the corresponding ports are passed to the JUnit test through the `maven-failsafe-plugin`. See [`BucketV2IT`](integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/BucketV2IT.kt) as an example on how it's used in the code.
299+
Our [integration tests](integration-tests) are using the Amazon S3 Client to verify the server functionality against the S3Mock. During the Maven build, the Docker image is started using the [docker-maven-plugin](https://dmp.fabric8.io/) and the corresponding ports are passed to the JUnit test through the `maven-failsafe-plugin`. See [`BucketIT`](integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/BucketIT.kt) as an example on how it's used in the code.
276300

277301
This way, one can easily switch between calling the S3Mock or the real S3 endpoint and this doesn't add any additional Java dependencies to the project.
278302

@@ -385,6 +409,51 @@ $ ls locals3root/my-test-bucket
385409
bucketMetadata.json
386410
```
387411

412+
#### Start using self-signed SSL certificate
413+
414+
S3Mock includes a self-signed SSL certificate:
415+
416+
```shell
417+
$ curl -vvv --insecure --request GET https://localhost:9191/my-test-bucket/my-file -O
418+
[...]
419+
* Server certificate:
420+
* subject: C=DE; ST=Hamburg; L=Hamburg; O=S3Mock; OU=S3Mock; CN=Adobe S3Mock
421+
* start date: Jul 25 12:28:53 2022 GMT
422+
* expire date: Nov 25 12:28:53 3021 GMT
423+
* issuer: C=DE; ST=Hamburg; L=Hamburg; O=S3Mock; OU=S3Mock; CN=Adobe S3Mock
424+
* SSL certificate verify result: self signed certificate (18), continuing anyway.
425+
[...]
426+
```
427+
428+
To use a custom self-signed SSL certificate, derive your own Docker container from the S3Mock container:
429+
430+
```dockerfile
431+
FROM adobe/s3mock:4.2.0
432+
433+
ENV server.ssl.key-store=/opt/customcert.jks
434+
ENV server.ssl.key-store-password=password
435+
ENV server.ssl.key-alias=selfsigned
436+
437+
RUN keytool -genkey -keyalg RSA -alias selfsigned \
438+
-validity 360 \
439+
-keystore /opt/customcert.jks \
440+
-dname "cn=Test, ou=Test, o=Docker, l=NY, st=NY, c=US" \
441+
-storepass password -keysize 2048 \
442+
-ext "san=dns:localhost"
443+
```
444+
445+
```shell
446+
$ curl -vvv --insecure --request GET https://localhost:9191/my-test-bucket/my-file -O
447+
[...]
448+
* Server certificate:
449+
* subject: C=US; ST=NY; L=NY; O=Docker; OU=Test; CN=Test
450+
* start date: May 9 14:33:40 2025 GMT
451+
* expire date: May 4 14:33:40 2026 GMT
452+
* issuer: C=US; ST=NY; L=NY; O=Docker; OU=Test; CN=Test
453+
* SSL certificate verify result: self signed certificate (18), continuing anyway.
454+
[...]
455+
```
456+
388457
### S3Mock Java
389458

390459
`S3Mock` Java libraries are released and published to the Sonatype Maven Repository and subsequently published to
@@ -575,9 +644,23 @@ This repo is built with Java 17, output is _currently_ bytecode compatible with
575644
### Kotlin
576645
The [Integration Tests](integration-tests) are built in Kotlin.
577646
647+
## Governance model
648+
649+
The project owner and leads makes all final decisions. See the `developers` section in the [pom.xml](pom.xml) for a list of leads.
650+
651+
## Vulnerability reports
652+
653+
S3Mock uses GitHub actions to produce an SBOM and to check dependencies for vulnerabilities. All vulnerabilities are evaluated and fixed if possible.
654+
Vulnerabilities may also be reported through the GitHub issue tracker.
655+
656+
## Security
657+
658+
S3Mock is not intended to be used in production environments. It is a mock server that is meant to be used in development and testing environments only. It does not implement all security features of AWS S3, and should not be used as a replacement for AWS S3 in production.
659+
It is implemented using [Spring Boot](https://github.com/spring-projects/spring-boot), which is a Java framework that is designed to be secure by default.
660+
578661
## Contributing
579662
580-
Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information.
663+
Contributions are welcome! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information.
581664
582665
## Licensing
583666

pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@
4242
</licenses>
4343

4444
<developers>
45-
<developer>
46-
<name>Andreas Gudian</name>
47-
<email>gudian@adobe.com</email>
48-
<organization>Adobe</organization>
49-
<organizationUrl>https://www.adobe.com</organizationUrl>
50-
</developer>
51-
<developer>
52-
<name>Timo Eckhardt</name>
53-
<email>eckhardt@adobe.com</email>
54-
<organization>Adobe</organization>
55-
<organizationUrl>https://www.adobe.com</organizationUrl>
56-
</developer>
5745
<developer>
5846
<name>Arne Franken</name>
5947
<email>franken@adobe.com</email>

server/src/main/resources/application-debug.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2017-2024 Adobe.
2+
# Copyright 2017-2025 Adobe.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -15,8 +15,9 @@
1515
#
1616

1717
# Enable debug logging for requests to better debug S3Mock
18-
#logging.level.root=debug
19-
logging.level.org.springframework.web=DEBUG
18+
logging.level.root=debug
19+
logging.level.org.springframework.web=debug
20+
logging.level.org.apache=debug
2021
spring.mvc.log-request-details=true
2122

2223
# Enable JMX when debugging

server/src/main/resources/application-trace.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2017-2024 Adobe.
2+
# Copyright 2017-2025 Adobe.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -16,4 +16,11 @@
1616

1717
logging.level.root=trace
1818
logging.level.org.springframework.web=trace
19+
logging.level.org.apache=trace
1920
spring.mvc.log-request-details=true
21+
22+
# Enable JMX when debugging
23+
spring.jmx.enabled=true
24+
25+
# Enable all actuator endpoints when debugging
26+
management.endpoints.web.exposure.include=*

0 commit comments

Comments
 (0)