
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
github.com/onsdigital/blaise-nifi-encrypt
Advanced tools
The encrypt function is triggered when a file arrives in a bucket, which is defined in the function configuration.
The file is encrypted using the build-in Golang PGP encryption functions with the stipulated public key and the
result placed in the bucket identified by the ENCRYPTION_DESTINATION environment variable.
The Golang libraries allow for the streaming of data into and out of the encryption routines with the result being that any sized file can be encrypted without being constrained by memory or storage considerations.
Set the default functions region:
gcloud config set functions/region europe-west2
Otherwise, functions will be created somewhere far away in the ether...
The following environment variables are available (see the testing section for details on how to create buckets):
PUBLIC_KEY=<path to gpg public key file> - required to encrypt the zip file
ENCRYPTION_DESTINATION=<bucket> - the GCloud bucket where the file that has been encrypted is located.
Placed there by the nifi_encrypt_function.
GOOGLE_APPLICATION_CREDENTIALS=<file> - google credentials file
LOG_FORMAT=Terminal|Json - (json is the default) for logging messages.
If you want pretty coloured output for local testing use Terminal
Debug=True|False|NotSet - set debugging
gcloud functions deploy NiFiEncryptFunction \
--runtime go122 \
--region=europe-west2 \
--trigger-event=google.cloud.storage.object.v1.finalized \
--trigger-resource="${NIFI_STAGING_BUCKET}" \
--set-env-vars PUBLIC_KEY="./serverless_function_source_code/pkg/encryption/keys/${ENV}-key.gpg,ENCRYPTION_DESTINATION=${NIFI_BUCKET}"
To run the test cases, you need to be in the directory where TESTFILE_test.go file exists. Run the following command to run the test cases and see the results
go test -v
To make sure that the changes you have made are working and have not broken anything:
The CIA team are responsible for generating the PGP encryption keys. When they expire the CIA team will send us new public keys, they will need to overwrite the existing public keys in this repository.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.