Skip to content

Instantly share code, notes, and snippets.

View coheigea's full-sized avatar

Colm O hEigeartaigh coheigea

View GitHub Profile
@coheigea
coheigea / sbom.md
Last active October 10, 2023 10:55
Santuario sbom
jakarta.activation/jakarta.activation-api:2.1.2,BSD-3-Clause
jakarta.xml.bind/jakarta.xml.bind-api:4.0.0,BSD-3-Clause
commons-codec/commons-codec:1.15,Apache-2.0
com.fasterxml.woodstox/woodstox-core:6.5.1,Apache-2.0
org.codehaus.woodstox/stax2-api:4.2.1,BSD-4-Clause
optConfig:
optOutStrategy: true
optOutArchivedRepos: true
disableRepoOverride: true
optOutForkedRepos: true
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on="lifecycleBeanPostProcessor"/>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor" />
@RequiresRoles("boss")
public int doubleIt(int numberToDouble) {
...
}
<util:list id="requiredRolesList">
<value>boss</value>
</util:list>
<bean class="org.apache.coheigea.cxf.shiro.authentication.ShiroUTValidator" id="utValidator">
<constructor-arg value="src/test/resources/securityconfig.ini"/>
<property name="requiredRoles" ref="requiredRolesList"/>
</bean>
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
PskStore pskStore = new StaticPskStore("some-identity", keyGenerator.generateKey().getEncoded());
context.getRegistry().bind("pskStore", pskStore);
fromF(getProtocol() + "://localhost:%d/TestResource?pskStore=#pskStore", PORT7)
.transform(body().prepend("Hello "));
from("direct:psk")
.toF(getProtocol() + "://localhost:%d/TestResource?pskStore=#pskStore", PORT7)
KeyStore keyStore = ...
PrivateKey privateKey = (PrivateKey)keyStore.getKey("service", "security".toCharArray());
PublicKey publicKey = keyStore.getCertificate("service").getPublicKey();
TrustedRpkStore trustedRpkStore = id -> {
return true;
};
context.getRegistry().bind("privateKey", privateKey);
context.getRegistry().bind("publicKey", publicKey);
context.getRegistry().bind("trustedRpkStore", trustedRpkStore);
<sslContextParameters id="clientSSLParameters" xmlns="http://camel.apache.org/schema/spring">
<trustManagers>
<keyStore resource="truststore.jks" password="storepass"/>
</trustManagers>
<cipherSuites>
<cipherSuite>TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256</cipherSuite>
</cipherSuites>
</sslContextParameters>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<sslContextParameters id="serverSSLParameters" xmlns="http://camel.apache.org/schema/spring">
<keyManagers keyPassword="security">
<keyStore resource="service.jks" password="security"/>
</keyManagers>
</sslContextParameters>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<restConfiguration scheme="coaps" component="coap" port="{{https.port}}">
<endpointProperty key="sslContextParameters" value="#serverSSLParameters" />
</restConfiguration>
<bean id="noopHostnameVerifier" class="org.apache.http.conn.ssl.NoopHostnameVerifier" />